Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HSQL In Memory DB with Junit

 
Singh Kuldeep
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I am trying to use hsqldb as in memory db with junit but it displaying some odd error. I am providing code, configuration, and error. If any one have any idea please help me.


/*
ERROR
*/
Running com.connecture.stateadvantage.process.registration.RegistrationProcessTest
2014-03-05 17:09:52,720 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaExport - Unsuccessful: create table SA_COMPANY_LOCATION (COMPANY_LOCATION_ID bigint not null, LOCATION_NAME varchar(255), LOCATION_TYPE_ID smallint, PRIMARY bit, ADDRESS_ID bigint
, COMPANY_ENROLLMENT_APP_ID bigint, primary key (COMPANY_LOCATION_ID))
2014-03-05 17:09:52,721 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaExport - Unexpected token BIT, requires KEY in statement [create table SA_COMPANY_LOCATION (COMPANY_LOCATION_ID bigint not null, LOCATION_NAME varchar(255), LOCATION_TYPE_ID small
int, PRIMARY bit]
2014-03-05 17:09:52,735 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaExport - Unsuccessful: alter table GPA_EG_EMPLOYMENT_TYPE add constraint FK958ECD37ECDC4377 foreign key (ELIGIBILITY_GROUP_ID) references GPA_ELIGIBILITY_GROUP
2014-03-05 17:09:52,736 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaExport - Column types do not match in statement [alter table GPA_EG_EMPLOYMENT_TYPE add constraint FK958ECD37ECDC4377 foreign key (ELIGIBILITY_GROUP_ID) references GPA_ELIGIBILITY
_GROUP]
2014-03-05 17:09:52,736 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaExport - Unsuccessful: alter table GPA_EG_LOCATION add constraint FK72B7CD6BECDC4377 foreign key (ELIGIBILITY_GROUP_ID) references GPA_ELIGIBILITY_GROUP
2014-03-05 17:09:52,736 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaExport - Column types do not match in statement [alter table GPA_EG_LOCATION add constraint FK72B7CD6BECDC4377 foreign key (ELIGIBILITY_GROUP_ID) references GPA_ELIGIBILITY_GROUP]

2014-03-05 17:09:52,736 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaExport - Unsuccessful: alter table GPA_EG_QUALIFIED_DEPENDENT add constraint FKE6E95F66ECDC4377 foreign key (ELIGIBILITY_GROUP_ID) references GPA_ELIGIBILITY_GROUP
2014-03-05 17:09:52,736 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaExport - Column types do not match in statement [alter table GPA_EG_QUALIFIED_DEPENDENT add constraint FKE6E95F66ECDC4377 foreign key (ELIGIBILITY_GROUP_ID) references GPA_ELIGIBI
LITY_GROUP]
2014-03-05 17:09:52,756 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaExport - Unsuccessful: alter table SA_COMPANY_LOCATION add constraint FKA7888F282CDADC63 foreign key (ADDRESS_ID) references SA_ADDRESS
2014-03-05 17:09:52,756 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaExport - Table not found: SA_COMPANY_LOCATION in statement [alter table SA_COMPANY_LOCATION]
2014-03-05 17:09:52,756 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaExport - Unsuccessful: alter table SA_COMPANY_LOCATION add constraint FKA7888F2873682BFA foreign key (COMPANY_ENROLLMENT_APP_ID) references SA_COMPANY_ENROLLMENT_APP
2014-03-05 17:09:52,756 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaExport - Table not found: SA_COMPANY_LOCATION in statement [alter table SA_COMPANY_LOCATION]
2014-03-05 17:09:52,757 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaExport - Unsuccessful: alter table SA_COMPANY_SUBGROUP add constraint FKBAB50FB2122B0138 foreign key (COMPANY_LOCATION_ID) references SA_COMPANY_LOCATION
2014-03-05 17:09:52,757 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaExport - Table not found in statement [alter table SA_COMPANY_SUBGROUP add constraint FKBAB50FB2122B0138 foreign key (COMPANY_LOCATION_ID) references SA_COMPANY_LOCATION]

Thank You
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The problem is this:

Unsuccessful: create table SA_COMPANY_LOCATION (COMPANY_LOCATION_ID bigint not null, LOCATION_NAME varchar(255), LOCATION_TYPE_ID smallint, PRIMARY bit, ADDRESS_ID bigint, COMPANY_ENROLLMENT_APP_ID bigint, primary key (COMPANY_LOCATION_ID))

Unexpected token BIT, requires KEY in statement [create table SA_COMPANY_LOCATION (COMPANY_LOCATION_ID bigint not null, LOCATION_NAME varchar(255), LOCATION_TYPE_ID smallint, PRIMARY bit]

Since "primary" is a keyword in SQL, you can't use it as an attribute name - rename the field to something that doesn't clash with a SQL keyword.
 
Singh Kuldeep
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ulf Dittmer, Now its working fine.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic