From: Gabor K. (JIRA) <no...@at...> - 2006-03-30 22:39:15
|
Reverse engineered VERSION columns cause ClassCastException ----------------------------------------------------------- Key: HBX-633 URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-633 Project: Hibernate Tools Type: Bug Versions: 3.1beta4 Environment: Oracle 8i, ojdbc14.jar Reporter: Gabor Kincses Exception in thread "main" java.lang.ClassCastException: org.hibernate.type.BigDecimalType at org.hibernate.tuple.PropertyFactory.buildVersionProperty(PropertyFactory.java:83) at org.hibernate.tuple.EntityMetamodel.<init>(EntityMetamodel.java:157) at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:412) at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:108) at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55) at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:216) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1176) at com.paypal.bdo.test.Hibernate101.main(Hibernate101.java:37) I guess the code tries to cast the type to VersionType. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Max R. A. (JIRA) <no...@at...> - 2006-03-30 22:56:14
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HBX-633?page=comments#action_22661 ] Max Rydahl Andersen commented on HBX-633: ----------------------------------------- please attach the DDL and resulting hbm.xml, thanks. > Reverse engineered VERSION columns cause ClassCastException > ----------------------------------------------------------- > > Key: HBX-633 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-633 > Project: Hibernate Tools > Type: Bug > Versions: 3.1beta4 > Environment: Oracle 8i, ojdbc14.jar > Reporter: Gabor Kincses > > > Exception in thread "main" java.lang.ClassCastException: org.hibernate.type.BigDecimalType > at org.hibernate.tuple.PropertyFactory.buildVersionProperty(PropertyFactory.java:83) > at org.hibernate.tuple.EntityMetamodel.<init>(EntityMetamodel.java:157) > at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:412) > at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:108) > at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55) > at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:216) > at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1176) > at com.paypal.bdo.test.Hibernate101.main(Hibernate101.java:37) > I guess the code tries to cast the type to VersionType. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Gabor K. (JIRA) <no...@at...> - 2006-03-30 23:04:23
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HBX-633?page=comments#action_22662 ] Gabor Kincses commented on HBX-633: ----------------------------------- DDL and generated hbm.xml: Name Null? Type ----------------------------------------- -------- ---------------------------- ITEM_ID NOT NULL NUMBER SEQUENCE NOT NULL NUMBER PRIORITY NOT NULL NUMBER RETRY_COUNT NOT NULL NUMBER ENQUEUE_TIME NOT NULL NUMBER FLAGS NUMBER TIME_CREATED NUMBER VERSION NUMBER FUNCTION_NAME VARCHAR2(100) MESSAGE BLOB <?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> <!-- Generated Mar 27, 2006 2:48:49 PM by Hibernate Tools 3.1.0.beta4 --> <hibernate-mapping> <class name="org.foo.Foo" table="FOO"> <composite-id name="id" class="org.foo.FooId"> <key-property name="itemId" type="big_decimal"> <column name="ITEM_ID" precision="22" scale="0" /> </key-property> <key-property name="sequence" type="big_decimal"> <column name="SEQUENCE" precision="22" scale="0" /> </key-property> </composite-id> <version name="version" type="big_decimal"> <column name="VERSION" precision="22" scale="0" /> </version> <property name="priority" type="big_decimal"> <column name="PRIORITY" precision="22" scale="0" not-null="true" /> </property> <property name="retryCount" type="big_decimal"> <column name="RETRY_COUNT" precision="22" scale="0" not-null="true" /> </property> <property name="enqueueTime" type="big_decimal"> <column name="ENQUEUE_TIME" precision="22" scale="0" not-null="true" /> </property> <property name="flags" type="big_decimal"> <column name="FLAGS" precision="22" scale="0" /> </property> <property name="timeCreated" type="big_decimal"> <column name="TIME_CREATED" precision="22" scale="0" /> </property> <property name="functionName" type="string"> <column name="FUNCTION_NAME" length="100" /> </property> <property name="message" type="blob"> <column name="MESSAGE" /> </property> </class> </hibernate-mapping> > Reverse engineered VERSION columns cause ClassCastException > ----------------------------------------------------------- > > Key: HBX-633 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-633 > Project: Hibernate Tools > Type: Bug > Versions: 3.1beta4 > Environment: Oracle 8i, ojdbc14.jar > Reporter: Gabor Kincses > > > Exception in thread "main" java.lang.ClassCastException: org.hibernate.type.BigDecimalType > at org.hibernate.tuple.PropertyFactory.buildVersionProperty(PropertyFactory.java:83) > at org.hibernate.tuple.EntityMetamodel.<init>(EntityMetamodel.java:157) > at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:412) > at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:108) > at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55) > at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:216) > at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1176) > at com.paypal.bdo.test.Hibernate101.main(Hibernate101.java:37) > I guess the code tries to cast the type to VersionType. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Max R. A. (JIRA) <no...@at...> - 2006-03-30 23:35:14
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HBX-633?page=comments#action_22663 ] Max Rydahl Andersen commented on HBX-633: ----------------------------------------- ok so the problem is that we too blindly select columns named VERSION to be version column. will also have to check that the resulting type is compatible. until then you can work around it via a custom reveng strategy that just returns false for useColumnForOptimisticLock. /max > Reverse engineered VERSION columns cause ClassCastException > ----------------------------------------------------------- > > Key: HBX-633 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-633 > Project: Hibernate Tools > Type: Bug > Versions: 3.1beta4 > Environment: Oracle 8i, ojdbc14.jar > Reporter: Gabor Kincses > > > Exception in thread "main" java.lang.ClassCastException: org.hibernate.type.BigDecimalType > at org.hibernate.tuple.PropertyFactory.buildVersionProperty(PropertyFactory.java:83) > at org.hibernate.tuple.EntityMetamodel.<init>(EntityMetamodel.java:157) > at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:412) > at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:108) > at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55) > at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:216) > at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1176) > at com.paypal.bdo.test.Hibernate101.main(Hibernate101.java:37) > I guess the code tries to cast the type to VersionType. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Ahmeed G. (JIRA) <no...@at...> - 2006-04-13 10:55:27
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HBX-633?page=comments#action_22736 ] Ahmeed GUEYE commented on HBX-633: ---------------------------------- So the bug is that when processing a column named VERSION, the tool generates a version tag (<version> ) instead of a regular property tag (<property>). You can manually change it in the mapping file until then. > Reverse engineered VERSION columns cause ClassCastException > ----------------------------------------------------------- > > Key: HBX-633 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-633 > Project: Hibernate Tools > Type: Bug > Versions: 3.1beta4 > Environment: Oracle 8i, ojdbc14.jar > Reporter: Gabor Kincses > > > Exception in thread "main" java.lang.ClassCastException: org.hibernate.type.BigDecimalType > at org.hibernate.tuple.PropertyFactory.buildVersionProperty(PropertyFactory.java:83) > at org.hibernate.tuple.EntityMetamodel.<init>(EntityMetamodel.java:157) > at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:412) > at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:108) > at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55) > at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:216) > at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1176) > at com.paypal.bdo.test.Hibernate101.main(Hibernate101.java:37) > I guess the code tries to cast the type to VersionType. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Stephane L. (JIRA) <no...@at...> - 2006-06-28 22:02:48
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HBX-633?page=comments#action_23462 ] Stephane Landelle commented on HBX-633: --------------------------------------- Hum, quite funny indeed... I'm trying to reverse engineer the spring jpetstore database and I run into the same kind of problem. In this case, the problem is a DATE column named TIMESTAMP. HibernateTool generates a version element with a date type but as org.hibernate.type.DateType doesn't implement org.hibernate.type.VersionType, I get a ClassCastException. > Reverse engineered VERSION columns cause ClassCastException > ----------------------------------------------------------- > > Key: HBX-633 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-633 > Project: Hibernate Tools > Type: Bug > Versions: 3.1beta4 > Environment: Oracle 8i, ojdbc14.jar > Reporter: Gabor Kincses > > > Exception in thread "main" java.lang.ClassCastException: org.hibernate.type.BigDecimalType > at org.hibernate.tuple.PropertyFactory.buildVersionProperty(PropertyFactory.java:83) > at org.hibernate.tuple.EntityMetamodel.<init>(EntityMetamodel.java:157) > at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:412) > at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:108) > at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55) > at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:216) > at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1176) > at com.paypal.bdo.test.Hibernate101.main(Hibernate101.java:37) > I guess the code tries to cast the type to VersionType. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |