-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Hibernate Error Cast Exception ??? what is this
PostPosted: Mon Apr 09, 2007 1:19 pm 
Newbie

Joined: Mon Apr 09, 2007 12:47 pm
Posts: 3
Hi people.

I become the following exception:

I use oracle db XE, with MySQL work well


DEBUG [main ] (AbstractEntityPersister.java:2738) - Static SQL for entity: hibernateModel.SetReportparameter
DEBUG [main ] (AbstractEntityPersister.java:2743) - Version select: select PARAMID from SET_REPORTPARAMETER where PARAMID =?
DEBUG [main ] (AbstractEntityPersister.java:2746) - Snapshot select: select setreportp_.PARAMID, setreportp_.REPORTID as REPORTID39_, setreportp_.CREATEDDATE as CREATEDD3_39_, setreportp_.CREATEDFROM as CREATEDF4_39_, setreportp_.PARAMNAME as PARAMNAME39_, setreportp_.PARAMTYPE as PARAMTYPE39_ from SET_REPORTPARAMETER setreportp_ where setreportp_.PARAMID=?
DEBUG [main ] (AbstractEntityPersister.java:2749) - Insert 0: insert into SET_REPORTPARAMETER (REPORTID, CREATEDDATE, CREATEDFROM, PARAMNAME, PARAMTYPE, PARAMID) values (?, ?, ?, ?, ?, ?)
DEBUG [main ] (AbstractEntityPersister.java:2750) - Update 0: update SET_REPORTPARAMETER set REPORTID=?, CREATEDDATE=?, CREATEDFROM=?, PARAMNAME=?, PARAMTYPE=? where PARAMID=?
DEBUG [main ] (AbstractEntityPersister.java:2751) - Delete 0: delete from SET_REPORTPARAMETER where PARAMID=?
java.lang.ClassCastException: org.hibernate.type.StringType cannot be cast to org.hibernate.type.VersionType
at org.hibernate.tuple.PropertyFactory.buildVersionProperty(PropertyFactory.java:84)
at org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:168)
at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:434)
at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:109)
at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:226)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1294)
at packages.EBIPGFunction.Init(EBIPGFunction.java:101)
at packages.EBIPGFunction.<init>(EBIPGFunction.java:59)
at packages..EBIMain.checkConnection(EBIMain.java:273)
at packages..EBIMain.<init>(EBIMain.java:261)
at packages..EBIMain.main(EBIMain.java:230)
ERROR [main ] (EBIExceptionDialog.java:40) -
Exception: org.hibernate.type.StringType cannot be cast to org.hibernate.type.VersionType

what goes wrong?

bye
Francesco


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 10, 2007 2:39 am 
Newbie

Joined: Mon Apr 09, 2007 12:47 pm
Posts: 3
nobody know this hibernate behaviour?

ciao
Francesco


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 10, 2007 3:27 am 
Newbie

Joined: Mon Apr 09, 2007 12:47 pm
Posts: 3
Hi i have resolved this problem,

my map files are generated from hibernate tools and i have one field in the database named VERSION hibernate tool make me from this field :
<version name="version" type="string">
<column name="VERSION" length="100" />
</version>
<many-to-one name="company" class="hibernateModel.Company" fetch="select">
<column name="COMPANYID" precision="20" scale="0" />
</many-to-one>
<property name="opportunityid" type="big_decimal">
<column name="OPPORTUNITYID" precision="20" scale="0" />
</property>

I renname this field to OpportunityVersion and now work well!!!

ciao
Francesco


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.