Well see here is the thing
Do you think there is a problem with how the fields are defined in the DB.
Because the first time I used Hibernate reverse engineering to generate the entity. It generated with Boolean as the type for those fields. Now it can't be Boolean, since in the DB the values it takes is 3, 4, 5,... etc. Any integer, so I tried first BigDecimal, tried Integer, tried Short. When I give any type other than Short, it complains it wants Short.
And when I give it Short I get the following error:
---------------------------------------------------------------------------------------------------------------------- Hibernate: select fce0_.COURSE_NO as COURSE1_46_0_, fce0_.SECTION as SECTION46_0_, fce0_.SEMESTER as SEMESTER46_0_, fce0_.SEQUENCE_NO as SEQUENCE4_46_0_, fce0_.ASSIGNMENTS as ASSIGNME5_46_0_, fce0_.COURSE_TOTAL as COURSE6_46_0_, fce0_.DATE_ENTERED as DATE7_46_0_, fce0_.DATE_UPDATED as DATE8_46_0_, fce0_.DISCUSSIONS as DISCUSSI9_46_0_, fce0_.ENTERED_BY as ENTERED10_46_0_, fce0_.EXAMS as EXAMS46_0_, fce0_.LECTURES as LECTURES46_0_, fce0_.OBJECTIVE as OBJECTIVE46_0_, fce0_.OVERALL_RATING as OVERALL14_46_0_, fce0_.RELEVANCY as RELEVANCY46_0_, fce0_.SEM_ORDER as SEM16_46_0_, fce0_.UPDATED_BY as UPDATED17_46_0_ from KARYN.FCE fce0_ where fce0_.COURSE_NO=? and fce0_.SECTION=? and fce0_.SEMESTER=? and fce0_.SEQUENCE_NO=? 16:52:37,495 INFO [STDOUT] Hibernate: select fceins0_.COURSE_NO as COURSE1_57_0_, fceins0_.FAC_ID as FAC2_57_0_, fceins0_.SECTION as SECTION57_0_, fceins0_.SEMESTER as SEMESTER57_0_, fceins0_.SEQUENCE_NO as SEQUENCE5_57_0_, fceins0_.ANSWER_N_FEEDBACK as ANSWER6_57_0_, fceins0_.CRITICAL_THINKING as CRITICAL7_57_0_, fceins0_.DATE_ENTERED as DATE8_57_0_, fceins0_.DATE_UPDATED as DATE9_57_0_, fceins0_.ENTERED_BY as ENTERED10_57_0_, fceins0_.ENTHUSIASM as ENTHUSIASM57_0_, fceins0_.OVERALL_RATING as OVERALL12_57_0_, fceins0_.SEM_ORDER as SEM13_57_0_, fceins0_.UPDATED_BY as UPDATED14_57_0_ from KARYN.FCE_INS fceins0_ where fceins0_.COURSE_NO=? and fceins0_.FAC_ID=? and fceins0_.SECTION=? and fceins0_.SEMESTER=? and fceins0_.SEQUENCE_NO=? 16:52:37,495 INFO [STDOUT] Hibernate: select fceta0_.COURSE_NO as COURSE1_56_0_, fceta0_.SECTION as SECTION56_0_, fceta0_.SEMESTER as SEMESTER56_0_, fceta0_.SEQUENCE_NO as SEQUENCE4_56_0_, fceta0_.TA_ID as TA5_56_0_, fceta0_.AVAILABLITY as AVAILABL6_56_0_, fceta0_.COMMUNICATION as COMMUNIC7_56_0_, fceta0_.DATE_ENTERED as DATE8_56_0_, fceta0_.DATE_UPDATED as DATE9_56_0_, fceta0_.ENTERED_BY as ENTERED10_56_0_, fceta0_.ENTHUSIASM as ENTHUSIASM56_0_, fceta0_.OVERALL_RATING as OVERALL12_56_0_, fceta0_.PATIENCE as PATIENCE56_0_, fceta0_.SEM_ORDER as SEM14_56_0_, fceta0_.UPDATED_BY as UPDATED15_56_0_ from KARYN.FCE_TA fceta0_ where fceta0_.COURSE_NO=? and fceta0_.SECTION=? and fceta0_.SEMESTER=? and fceta0_.SEQUENCE_NO=? and fceta0_.TA_ID=? 16:52:37,557 INFO [STDOUT] Hibernate: insert into KARYN.FCE (ASSIGNMENTS, COURSE_TOTAL, DATE_ENTERED, DATE_UPDATED, DISCUSSIONS, ENTERED_BY, EXAMS, LECTURES, OBJECTIVE, OVERALL_RATING, RELEVANCY, SEM_ORDER, UPDATED_BY, COURSE_NO, SECTION, SEMESTER, SEQUENCE_NO) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) 16:52:37,557 INFO [STDOUT] Invalid Value: #0--semester 16:52:37,557 INFO [STDOUT] Invalid Value: #0--courseNo 16:52:37,557 INFO [STDOUT] Invalid Value: #0--section 16:52:37,557 INFO [STDOUT] mode is viewFacCourseEval 16:52:37,636 INFO [STDOUT] Hibernate: insert into KARYN.FCE (ASSIGNMENTS, COURSE_TOTAL, DATE_ENTERED, DATE_UPDATED, DISCUSSIONS, ENTERED_BY, EXAMS, LECTURES, OBJECTIVE, OVERALL_RATING, RELEVANCY, SEM_ORDER, UPDATED_BY, COURSE_NO, SECTION, SEMESTER, SEQUENCE_NO) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) 16:52:37,636 INFO [ShortType] could not bind value '3' to parameter: 1; The statement is closed. 16:52:37,636 WARN [JDBCExceptionReporter] SQL Error: 0, SQLState: null 16:52:37,636 ERROR [JDBCExceptionReporter] The statement is closed. 16:52:37,636 ERROR [AbstractFlushingEventListener] Could not synchronize database state with session org.hibernate.exception.GenericJDBCException: could not insert: [edu.cmu.heinz.hcis.entity.Fce] at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103) at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43) at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2267) at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2660) at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:56) at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:250) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:234) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:141) at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298) at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27) at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000) at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338) at org.hibernate.ejb.AbstractEntityManagerImpl$1.beforeCompletion(AbstractEntityManagerImpl.java:523) at com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple.beforeCompletion(SynchronizationImple.java:114) at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.beforeCompletion(TwoPhaseCoordinator.java:247) at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.end(TwoPhaseCoordinator.java:86) at com.arjuna.ats.arjuna.AtomicAction.commit(AtomicAction.java:177) at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1406) at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:135) at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.commit(BaseTransactionManagerDelegate.java:87) at org.jboss.tm.usertx.client.ServerVMClientUserTransaction.commit(ServerVMClientUserTransaction.java:146) at org.jboss.seam.transaction.UTTransaction.commit(UTTransaction.java:52) at org.jboss.seam.jsf.SeamPhaseListener.commitOrRollback(SeamPhaseListener.java:603) at org.jboss.seam.jsf.SeamPhaseListener.handleTransactionsAfterPhase(SeamPhaseListener.java:341) at org.jboss.seam.jsf.SeamPhaseListener.afterServletPhase(SeamPhaseListener.java:241) at org.jboss.seam.jsf.SeamPhaseListener.afterPhase(SeamPhaseListener.java:192) at com.sun.faces.lifecycle.Phase.handleAfterPhase(Phase.java:175) at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:114) at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83) at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85) at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64) at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45) at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:177) at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:267) at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:380) at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:507) at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60) at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58) at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68) at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at -------------------------------------------------------------------------------------------------------------- The important part is the stack trace when it is trying to insert into FCE. Maybe it will give you some idea..
P.S: Thanks for the quick reply thanks Sai
|