mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-08-05 20:22:43 +00:00
* refactor: drop tables according to their dependencies * refactor: renamed table because USER is an SQL keyword * dep: upgrade com.h2database.h2 1.4.190 to 2.1.214
This commit is contained in:
@@ -34,8 +34,8 @@ import org.h2.jdbcx.JdbcDataSource;
|
||||
@Slf4j
|
||||
public class DatabaseUtil {
|
||||
private static final String DB_URL = "jdbc:h2:mem:metamapping";
|
||||
private static final String CREATE_SCHEMA_SQL = "DROP TABLE IF EXISTS `user`;"
|
||||
+ "CREATE TABLE `user` (\n"
|
||||
private static final String CREATE_SCHEMA_SQL = "DROP TABLE IF EXISTS `user_account`;"
|
||||
+ "CREATE TABLE `user_account` (\n"
|
||||
+ " `id` int(11) NOT NULL AUTO_INCREMENT,\n"
|
||||
+ " `username` varchar(255) NOT NULL,\n"
|
||||
+ " `password` varchar(255) NOT NULL,\n"
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
|
||||
|
||||
<hibernate-mapping>
|
||||
<class name="com.iluwatar.metamapping.model.User" table="user">
|
||||
<class name="com.iluwatar.metamapping.model.User" table="user_account">
|
||||
<id name="id" type="java.lang.Integer" column="id">
|
||||
<generator class="native"/>
|
||||
</id>
|
||||
|
||||
Reference in New Issue
Block a user