org.hibernate.TypeMismatchException:
来源:百度知道 编辑:UC知道 时间:2024/06/20 17:20:43
org.hibernate.TypeMismatchException: Provided id of the wrong type. Expected: class java.lang.Integer, got class java.lang.String
哪的错
at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:86)
at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:878)
at org.hibernate.impl.SessionImpl.load(SessionImpl.java:795)
at org.hibernate.impl.SessionImpl.load(SessionImpl.java:788)
at com.jj.hibernate.OneToManyTest.testLoad(OneToManyTest.java:70)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framewor
哪的错
at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:86)
at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:878)
at org.hibernate.impl.SessionImpl.load(SessionImpl.java:795)
at org.hibernate.impl.SessionImpl.load(SessionImpl.java:788)
at com.jj.hibernate.OneToManyTest.testLoad(OneToManyTest.java:70)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framewor
问题:传入类型错误
错误详细信息是:load(className.class, type);
type应该输入数据类型是Integer, 而不是String类型
纠正:type=Integer
提供了错误的id类型,期待一个Integer类型,却得到一个String类型
org.hibernate.MappingException:
org.hibernate.exception.JDBCConnectionException: Cannot open connection
org.hibernate.exception.GenericJDBCException: Cannot open connection
org.hibernate.tool.ant.HibernateToolTask在那个包下面?
org.hibernate.mappingException:Could not read mappings from resource:
org.hibernate.HibernateException: Found two representations of same collection
org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
异常:ERROR [org.hibernate.proxy.BasicLazyInitializer] - CGLIB Enhancement failed...
hibernate
Hibernate