diff --git a/src/main/java/com/loafle/overflow/module/member/model/Member.java b/src/main/java/com/loafle/overflow/module/member/model/Member.java index 7f72b34..4d243cc 100644 --- a/src/main/java/com/loafle/overflow/module/member/model/Member.java +++ b/src/main/java/com/loafle/overflow/module/member/model/Member.java @@ -29,8 +29,7 @@ public class Member { } @Id - @GeneratedValue(strategy= GenerationType.AUTO, generator = "MEMBER_ID_SEQ") - @SequenceGenerator(name = "MEMBER_ID_SEQ", sequenceName = "MEMBER_ID_SEQ", allocationSize = 1) + @GeneratedValue(strategy= GenerationType.IDENTITY) public long getId() { return id; } diff --git a/src/main/resources/init.sql b/src/main/resources/init.sql index 7f06cf6..0eacd57 100644 --- a/src/main/resources/init.sql +++ b/src/main/resources/init.sql @@ -379,11 +379,11 @@ INSERT INTO public.meta_vendor_crawler (id,create_date,crawler_id,vendor_id) VAL -INSERT INTO public."member" (id,company_name,create_date,email,"name",phone,pw,status_id) VALUES ( -nextval('member_id_seq'),'loafle','2017-06-26 11:07:27.625','overflow@loafle.com','overFlow','000-000-0000','qwer5795',2); +INSERT INTO public."member" (company_name,create_date,email,"name",phone,pw,status_id) VALUES ( +'loafle','2017-06-26 11:07:27.625','overflow@loafle.com','overFlow','000-000-0000','qwer5795',2); -INSERT INTO public."member" (id,company_name,create_date,email,"name",phone,pw,status_id) VALUES ( -nextval('member_id_seq'),'loafle','2017-06-26 11:07:27.625','geek@loafle.com','geek','000-000-0000','qwer5795',1); +INSERT INTO public."member" (company_name,create_date,email,"name",phone,pw,status_id) VALUES ( +'loafle','2017-06-26 11:07:27.625','geek@loafle.com','geek','000-000-0000','qwer5795',1); INSERT INTO public.email_auth (auth_confirm_date,create_date,email_auth_key,member_id) VALUES ( NULL,'2017-06-26 15:28:48.895','dbseogns1234',1); diff --git a/src/test/java/com/loafle/overflow/module/member/dao/MemberDAOTest.java b/src/test/java/com/loafle/overflow/module/member/dao/MemberDAOTest.java index 33be9c0..8154f7a 100644 --- a/src/test/java/com/loafle/overflow/module/member/dao/MemberDAOTest.java +++ b/src/test/java/com/loafle/overflow/module/member/dao/MemberDAOTest.java @@ -5,6 +5,7 @@ import com.loafle.overflow.module.meta.model.MetaMemberStatus; import com.loafle.overflow.spring.AppConfig; import com.loafle.overflow.spring.JdbcConfiguration; import com.loafle.overflow.spring.MailConfiguration; +import org.junit.Assert; import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; @@ -33,10 +34,11 @@ public class MemberDAOTest { m.setCompanyName("loafle"); m.setPw("bbbbbbbbb"); m.setPhone("000-000-0000"); - m.setEmail("insanity111@loafle.com"); + m.setEmail("insanity1112@loafle.com"); m.setStatus(new MetaMemberStatus((short)3)); repo.save(m); + Assert.assertNotEquals(m.getId(), 0); } @Test