Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

HSQL In Memory DB with Junit

 
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
 
Rancher
Posts: 43016
76
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic