Member model sequence annotation modify

This commit is contained in:
geek 2017-07-28 18:06:17 +09:00
parent fa20746ab1
commit 1839bee466
3 changed files with 8 additions and 7 deletions

View File

@ -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;
}

View File

@ -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);

View File

@ -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