From fa20746ab1cf9048365a53714dd363169076f028 Mon Sep 17 00:00:00 2001 From: geek Date: Fri, 28 Jul 2017 17:13:25 +0900 Subject: [PATCH] Member model sequence annotation modify --- .../java/com/loafle/overflow/module/member/model/Member.java | 3 ++- src/main/resources/init.sql | 4 ++-- .../com/loafle/overflow/module/member/dao/MemberDAOTest.java | 5 +++-- 3 files changed, 7 insertions(+), 5 deletions(-) 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 4d243cc..7f72b34 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,7 +29,8 @@ public class Member { } @Id - @GeneratedValue(strategy= GenerationType.IDENTITY) + @GeneratedValue(strategy= GenerationType.AUTO, generator = "MEMBER_ID_SEQ") + @SequenceGenerator(name = "MEMBER_ID_SEQ", sequenceName = "MEMBER_ID_SEQ", allocationSize = 1) public long getId() { return id; } diff --git a/src/main/resources/init.sql b/src/main/resources/init.sql index 419f2e9..7f06cf6 100644 --- a/src/main/resources/init.sql +++ b/src/main/resources/init.sql @@ -380,10 +380,10 @@ 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 ( -1,'loafle','2017-06-26 11:07:27.625','overflow@loafle.com','overFlow','000-000-0000','qwer5795',2); +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" (id,company_name,create_date,email,"name",phone,pw,status_id) VALUES ( -2,'loafle','2017-06-26 11:07:27.625','geek@loafle.com','geek','000-000-0000','qwer5795',1); +nextval('member_id_seq'),'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 7d13e33..33be9c0 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 @@ -24,7 +24,7 @@ public class MemberDAOTest { @Autowired private MemberDAO repo; - @Ignore +// @Ignore @Test public void createMember() { Member m = new Member(); @@ -34,7 +34,8 @@ public class MemberDAOTest { m.setPw("bbbbbbbbb"); m.setPhone("000-000-0000"); m.setEmail("insanity111@loafle.com"); - m.setStatus(new MetaMemberStatus((short)1)); + m.setStatus(new MetaMemberStatus((short)3)); + repo.save(m); }