Hibernate Database Generation Error in Spring -


i'm having error when i'm creating in-memory database. when start program on tomcat server, seems run fine, until try , insert database. tomcat log reveals following:

hibernate: alter table brokerreferrerjoin drop constraint fk_cfc92321040c4c7e94cd7d7f0f0 hibernate: alter table brokertable drop constraint fk_85c86a6cd9d14a23840e4746545 hibernate: alter table leadtable drop constraint fk_26c301acde8d4daa93734bda8ff hibernate: alter table leadtable drop constraint fk_d358f93455874bcba7ed6afd996 hibernate: alter table referrerbrokerjoin drop constraint fk_60dc4e2e6a44406a8fdf4e869e8 hibernate: alter table referrertable drop constraint fk_910ad4a791e9434da73fbc24ba5 hibernate: drop table brokerreferrerjoin if exists hibernate: drop table brokertable if exists hibernate: drop table leadtable if exists hibernate: drop table person if exists hibernate: drop table referrerbrokerjoin if exists hibernate: drop table referrertable if exists hibernate: alter table brokerreferrerjoin drop constraint fk_7100b66fe58043ed9fcba0c116c hibernate: alter table brokertable drop constraint fk_b5a6bbb0789c46b39597c4eb788 hibernate: alter table leadtable drop constraint fk_e19293e489d2443f80cef09bf10 hibernate: alter table leadtable drop constraint fk_0a56acd9932f4f4f930f1b4c23b hibernate: alter table referrerbrokerjoin drop constraint fk_c700fee7563d461fb33336901e7 hibernate: alter table referrertable drop constraint fk_c449adf2fb9e4f4d985c944d852 hibernate: drop table brokerreferrerjoin if exists hibernate: drop table brokertable if exists hibernate: drop table leadtable if exists hibernate: drop table person if exists hibernate: drop table referrerbrokerjoin if exists hibernate: drop table referrertable if exists hibernate: create table brokerreferrerjoin (flexrowidlink varchar(255) not null, internalreferreridlink varchar(255) not null) hibernate: create table brokertable (adminid varchar(255), isadmin boolean, flexrowid varchar(255) not null, primary key (flexrowid)) hibernate: create table leadtable (leadid varchar(255) generated default identity (start 1), amount double, flexrowid varchar(255), leademail varchar(50), leadfname varchar(50) not null, hphoneno integer, leadlname varchar(50) not null, mphoneno bigint, notes varchar(4095), wphoneno integer, status varchar(255), loantype varchar(255), leadbroker_flexrowid varchar(255), leadreferrer_flexrowid varchar(255), primary key (leadid)) hibernate: create table person (flexrowid varchar(255) not null, createdon date, email varchar(255), fname varchar(255), lname varchar(255), lastupdated date, orgid varchar(255), orgname varchar(255), username varchar(255), primary key (flexrowid)) hibernate: create table referrerbrokerjoin (internalreferreridlink varchar(255) not null, flexrowidlink varchar(255) not null) hibernate: create table referrertable (ltsrowid varchar(255), flexrowid varchar(255) not null, primary key (flexrowid)) hibernate: alter table brokerreferrerjoin add constraint uk_bc91f298149c4420bc453811411 unique (internalreferreridlink) hibernate: alter table brokerreferrerjoin add constraint fk_7100b66fe58043ed9fcba0c116c foreign key (flexrowidlink) references brokertable hibernate: alter table brokertable add constraint fk_b5a6bbb0789c46b39597c4eb788 foreign key (flexrowid) references person hibernate: alter table leadtable add constraint fk_e19293e489d2443f80cef09bf10 foreign key (leadbroker_flexrowid) references brokertable hibernate: alter table leadtable add constraint fk_0a56acd9932f4f4f930f1b4c23b foreign key (leadreferrer_flexrowid) references referrertable hibernate: alter table referrerbrokerjoin add constraint uk_836e448745504545aaa39709e22 unique (flexrowidlink) hibernate: alter table referrerbrokerjoin add constraint fk_c700fee7563d461fb33336901e7 foreign key (flexrowidlink) references brokertable hibernate: alter table referrertable add constraint uk_b0c668bb487b4a1d8b5f7b9657b unique (ltsrowid) hibernate: alter table referrertable add constraint fk_c449adf2fb9e4f4d985c944d852 foreign key (flexrowid) references person 18:52:45.573 [http-bio-8080-exec-3] error com.au.curtin.lead.hibernateleaddao - sessionfactory set: org.springframework.orm.hibernate4.localsessionfactorybean@6c80d028 18:52:45.592 [http-bio-8080-exec-3] error com.au.curtin.lead.leadserviceclass - hibernateleaddao set: com.au.curtin.lead.hibernateleaddao@1c90a278 18:52:49.862 [http-bio-8080-exec-7] error com.au.curtin.logincontroller - starting logger 18:52:54.253 [http-bio-8080-exec-9] error com.au.curtin.leadcontroller - returning referrer home view 18:53:01.035 [http-bio-8080-exec-10] error com.au.curtin.leadcontroller - org.springframework.validation.beanpropertybindingresult: 0 errors 18:53:01.035 [http-bio-8080-exec-10] error com.au.curtin.lead.leadserviceclass - home phone number: 94572707work phone number : nullmobile phone number: nullemail : 18:53:01.098 [http-bio-8080-exec-10] error com.au.curtin.lead.leadserviceclass - com.au.curtin.lead.hibernateleaddao@1c90a278 18:53:01.098 [http-bio-8080-exec-10] error com.au.curtin.lead.hibernateleaddao - lead : lead [leadid=null, flexrowid=null, leadfirstname=james, leadlastname=massey, leadhomephonenumber=94572707, leadworkphonenumber=null, leadmobilephonenumber=null, borrowingamount=1000.0, leademail=, loantype=null, leadnotes=, leadbroker=null, leadreferrer=null, loanstatus=null]session is: sessionimpl(persistencecontext[entitykeys=[],collectionkeys=[]];actionqueue[insertions=[] updates=[] deletions=[] collectioncreations=[] collectionremovals=[] collectionupdates=[] unresolvedinsertdependencies=unresolvedentityinsertactions[]]) hibernate: insert leadtable (leadid, amount, flexrowid, leadbroker_flexrowid, leademail, leadfname, hphoneno, leadlname, mphoneno, notes, leadreferrer_flexrowid, wphoneno, status, loantype) values (default, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) 

i don't know why causing error. fields set annotations. here spring .xml

<?xml version="1.0" encoding="utf-8"?> <beans xmlns="http://www.springframework.org/schema/beans"     xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:aop="http://www.springframework.org/schema/aop"     xmlns:context="http://www.springframework.org/schema/context"     xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:tx="http://www.springframework.org/schema/tx"     xmlns:jdbc="http://www.springframework.org/schema/jdbc"     xsi:schemalocation="http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.1.xsd         http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.1.xsd         http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd         http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd         http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd         http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd">      <tx:annotation-driven transaction-manager="transactionmanager" />     <jdbc:embedded-database id="ltsdatabase" type="hsql" />     <context:component-scan base-package="x.y" />      <bean id="sessionfactory"         class="org.springframework.orm.hibernate4.localsessionfactorybean">         <property name="datasource" ref="ltsdatabase" />         <property name="annotatedclasses">             <list>                 <value>x.y.lead</value>                 <value>x.y.broker</value>                 <value>x.y.referrer</value>             </list>         </property>         <property name="hibernateproperties">             <props>                 <prop key="hibernate.dialect">org.hibernate.dialect.hsqldialect</prop>                 <prop key="hibernate.show_sql">true</prop>                 <prop key="hibernate.hbm2ddl.auto">update</prop>             </props>         </property>     </bean>      <bean id="persistenceannotationpostprocessor"         class="org.springframework.orm.jpa.support.persistenceannotationbeanpostprocessor" />     <bean id="hibernateexceptiontranslator"         class="org.springframework.orm.hibernate4.hibernateexceptiontranslator" />     <bean         class="org.springframework.dao.annotation.persistenceexceptiontranslationpostprocessor"         id="persistenceexceptiontranslator" depends-on="hibernateexceptiontranslator" />      <bean id="transactionmanager"         class="org.springframework.orm.hibernate4.hibernatetransactionmanager">         <property name="sessionfactory" ref="sessionfactory" />     </bean> </beans> 

as can see i'm using annotations setting database, , transactions. don't know why error occurring. if knows why happening, please tell me.

i'm using spring 3, hibernate 4.2, , tomcat 7 if helps.

just in case helps anyone, problem was trying make field going primary key declared string. hibernate can't handle non-numerical auto-generated primary key.


Comments

Popular posts from this blog

Change php variable from jquery value using ajax (same page) -

Pull out data related to my apps from Android Play Store and iOS App Store -

How can I fetch data from a web server in an android application? -