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.  [ 15 posts ] 
Author Message
 Post subject: java.lang.ClassCastException when creating session factory
PostPosted: Wed Oct 25, 2006 11:38 am 
Newbie

Joined: Mon Oct 23, 2006 6:54 am
Posts: 15
Hibernate version:
Hibernate 3.2.0
tools 3.2 beta 8
Name and version of the database you are using:
MSSQL 2000
weblogic mssqlserver4v65.jar jdbc driver

Hi,

I am using the hibernatetool task to generate hmb and javafiles. When I try to create the session factory I get an java.lang.ClassCastException. There is probably something wrong with the generated code?

Code:

Configuration c = new Configuration();
c.setProperty("hibernate.show_sql", "true");
sessionFactory = c.configure().buildSessionFactory();

This is from the hibernate log....

[java] BLH main DEBUG org.hibernate.persister.entity.AbstractEntityPersister - Snapshot select: select xmessagety_.messageType, xmessagety_.serverCount as serverCo2_32_, xmessagety_.onServer as onServer32_ from devtest3.dbo.XMessageTypeOnServer xmessagety_ where xmessagety_.messageType=?
[java] BLH main DEBUG org.hibernate.persister.entity.AbstractEntityPersister - Insert 0: insert into devtest3.dbo.XMessageTypeOnServer (serverCount, onServer, messageType) values (?, ?, ?)
[java] BLH main DEBUG org.hibernate.persister.entity.AbstractEntityPersister - Update 0: update devtest3.dbo.XMessageTypeOnServer set serverCount=?, onServer=? where messageType=?
[java] BLH main DEBUG org.hibernate.persister.entity.AbstractEntityPersister - Delete 0: delete from devtest3.dbo.XMessageTypeOnServer where messageType=?
[java] BLH main DEBUG org.hibernate.persister.entity.AbstractEntityPersister - Static SQL for entity: no.xlink.hibernate.generated.XSellerPart
[java] BLH main DEBUG org.hibernate.persister.entity.AbstractEntityPersister - Version select: select PK from devtest3.dbo.XSellerPart where PK =?
[java] BLH main DEBUG org.hibernate.persister.entity.AbstractEntityPersister - Snapshot select: select xsellerpar_.PK, xsellerpar_.XCatalog as XCatalog33_, xsellerpar_.XGroupProducer as XGroupPr3_33_, xsellerpar_.XPriceCategory as XPriceCa4_33_, xsellerpar_.ABC as ABC33_, xsellerpar_.CostPrice as CostPrice33_, xsellerpar_.CreationDate as Creation7_33_, xsellerpar_.Description as Descript8_33_, xsellerpar_.Expired as Expired33_, xsellerpar_.LongDescriptionURL as LongDes10_33_, xsellerpar_.ModDate as ModDate33_, xsellerpar_.DeletionDate as Deletio12_33_, xsellerpar_.Name as Name33_, xsellerpar_.NumberInUnit as NumberI14_33_, xsellerpar_.PriceUnitFactor as PriceUn15_33_, xsellerpar_.UnitPrice as UnitPrice33_, xsellerpar_.PictureURL as PictureURL33_, xsellerpar_.PriceCategoryCode as PriceCa18_33_, xsellerpar_.ProducerCode as Produce19_33_, xsellerpar_.ProducerPartno as Produce20_33_, xsellerpar_.SalesPrice as SalesPrice33_, xsellerpar_.Vat as Vat33_, xsellerpar_.NumberOnStock as NumberO23_33_, xsellerpar_.DateNumberOnStock as DateNum24_33_, xsellerpar_.SellerPartno as SellerP25_33_, xsellerpar_.PartType as PartType33_, xsellerpar_.EANno as EANno33_, xsellerpar_.ExtraPartno1 as ExtraPa28_33_, xsellerpar_.ExtraPartno2 as ExtraPa29_33_, xsellerpar_.Substitute as Substitute33_, xsellerpar_.Unit as Unit33_, xsellerpar_.ModDescription as ModDesc32_33_, xsellerpar_.PartExtra as PartExtra33_, xsellerpar_.PartTypeRank as PartTyp34_33_, xsellerpar_.PartTypeDescription as PartTyp35_33_, xsellerpar_.InvoicePrice as Invoice36_33_, xsellerpar_.Measurement as Measure37_33_, xsellerpar_.measurementCode as measure38_33_, xsellerpar_.Bonus as Bonus33_, xsellerpar_.ExpiredReason as Expired40_33_, xsellerpar_.OldPartType as OldPart41_33_, xsellerpar_.OldSellerPartno as OldSell42_33_, xsellerpar_.CampaignFromDate as Campaig43_33_, xsellerpar_.CampaignToDate as Campaig44_33_, xsellerpar_.CampaignDescription as Campaig45_33_ from devtest3.dbo.XSellerPart xsellerpar_ where xsellerpar_.PK=?
[java] BLH main DEBUG org.hibernate.persister.entity.AbstractEntityPersister - Insert 0: insert into devtest3.dbo.XSellerPart (XCatalog, XGroupProducer, XPriceCategory, ABC, CostPrice, CreationDate, Description, Expired, LongDescriptionURL, ModDate, DeletionDate, Name, NumberInUnit, PriceUnitFactor, UnitPrice, PictureURL, PriceCategoryCode, ProducerCode, ProducerPartno, SalesPrice, Vat, NumberOnStock, DateNumberOnStock, SellerPartno, PartType, EANno, ExtraPartno1, ExtraPartno2, Substitute, Unit, ModDescription, PartExtra, PartTypeRank, PartTypeDescription, InvoicePrice, Measurement, measurementCode, Bonus, ExpiredReason, OldPartType, OldSellerPartno, CampaignFromDate, CampaignToDate, CampaignDescription, PK) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
[java] BLH main DEBUG org.hibernate.persister.entity.AbstractEntityPersister - Update 0: update devtest3.dbo.XSellerPart set XCatalog=?, XGroupProducer=?, XPriceCategory=?, ABC=?, CostPrice=?, CreationDate=?, Description=?, Expired=?, LongDescriptionURL=?, ModDate=?, DeletionDate=?, Name=?, NumberInUnit=?, PriceUnitFactor=?, UnitPrice=?, PictureURL=?, PriceCategoryCode=?, ProducerCode=?, ProducerPartno=?, SalesPrice=?, Vat=?, NumberOnStock=?, DateNumberOnStock=?, SellerPartno=?, PartType=?, EANno=?, ExtraPartno1=?, ExtraPartno2=?, Substitute=?, Unit=?, ModDescription=?, PartExtra=?, PartTypeRank=?, PartTypeDescription=?, InvoicePrice=?, Measurement=?, measurementCode=?, Bonus=?, ExpiredReason=?, OldPartType=?, OldSellerPartno=?, CampaignFromDate=?, CampaignToDate=?, CampaignDescription=? where PK=?
[java] BLH main DEBUG org.hibernate.persister.entity.AbstractEntityPersister - Delete 0: delete from devtest3.dbo.XSellerPart where PK=?
[java] Initial SessionFactory creation failed.java.lang.ClassCastException
[java] java.lang.ExceptionInInitializerError
[java] at no.xlink.hibernate.HibernateUtil.<clinit>(HibernateUtil.java:19)
[java] at no.xlink.hibernate.Test.listGroups(Test.java:26)
[java] at no.xlink.hibernate.Test.main(Test.java:18)
[java] Caused by: java.lang.ClassCastException
[java] at org.hibernate.tuple.PropertyFactory.buildVersionProperty(PropertyFactory.java:84)
[java] at org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:160)
[java] at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:425)
[java] at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:109)
[java] at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55)
[java] at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:226)
[java] at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1218)
[java] at no.xlink.hibernate.HibernateUtil.<clinit>(HibernateUtil.java:15)
[java] ... 2 more
[java] Exception in thread "main"
[java]


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 26, 2006 2:19 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
try and disable optimistic lock detection...somehow a column named version and/or timestamp is not of the expected type.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 26, 2006 3:30 am 
Newbie

Joined: Mon Oct 23, 2006 6:54 am
Posts: 15
Tanx :) That solved my problem...

But is this a bug or?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 26, 2006 3:40 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
i would like to see the hbm.xml that has the improper type.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 26, 2006 4:28 am 
Newbie

Joined: Mon Oct 23, 2006 6:54 am
Posts: 15
max wrote:
i would like to see the hbm.xml that has the improper type.

I would post it here if I knew whitch file it was. I am generating over 50 files :)

This is my first attempt with hibernate :)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 26, 2006 5:16 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
first attempt ? then start with the tutorial....don't just reverse engineer out in the blue ;)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 26, 2006 5:39 am 
Newbie

Joined: Mon Oct 23, 2006 6:54 am
Posts: 15
max wrote:
first attempt ? then start with the tutorial....don't just reverse engineer out in the blue ;)

I have done my own toturial... I made two tables with relations and generated code with ant. No problems there :) I have tried to insert and select and so on.. all works fine.
But whan I tried to generate code from the database I plan to use in combination with hibernate I got the error posted in this thread. My problem is that I cant see where the problem is. Luckily setting detectOptimisticLock="false" solved my initial problem and now I can select and insert with the generated code :) , but it would be nice to know why I got the exception :) I cant see from the log posted in this thread that it is refering to any specific hbm file or field. Is there a way to isolate this error?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 26, 2006 5:48 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
look for any timestamp and version tags in the generated hbm.xml....they are the hbm.xml that is causing this.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 26, 2006 6:51 am 
Newbie

Joined: Mon Oct 23, 2006 6:54 am
Posts: 15
timestamp is in most tables (34 tables)...
I cant see version as a type...

eg...
....
With optimistic locking...
<?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 26.okt.2006 12:14:13 by Hibernate Tools 3.2.0.beta8 -->
<hibernate-mapping>
<class name="no.xlink.hibernate.generated.XUser" table="XUser" schema="dbo" catalog="devtest3">
<id name="pk" type="big_decimal">
<column name="PK" precision="20" scale="0" />
<generator class="assigned" />
</id>
<many-to-one name="xlocale" class="no.xlink.hibernate.generated.XLocale" fetch="select">
<column name="XLocale" precision="20" scale="0" />
</many-to-one>
<many-to-one name="xgroup" class="no.xlink.hibernate.generated.XGroup" fetch="select">
<column name="XGroup" precision="20" scale="0" />
</many-to-one>
<property name="isActive" type="java.lang.Integer">
<column name="IsActive" />
</property>
<property name="localUser" type="java.lang.Integer">
<column name="LocalUser" />
</property>
<property name="useHttps" type="java.lang.Integer">
<column name="UseHTTPS" />
</property>
<property name="loginName" type="string">
<column name="LoginName" />
</property>
<property name="password" type="string">
<column name="Password" />
</property>
<property name="description" type="string">
<column name="Description" />
</property>
<property name="userPrivileges" type="string">
<column name="UserPrivileges" length="6000" />
</property>
<property name="faxNumber" type="string">
<column name="FaxNumber" />
</property>
<property name="firstName" type="string">
<column name="FirstName" />
</property>
<property name="lastName" type="string">
<column name="LastName" />
</property>
<property name="emailAddress" type="string">
<column name="EmailAddress" />
</property>
<property name="mobilePhoneNumber" type="string">
<column name="MobilePhoneNumber" />
</property>
<property name="workPhoneNumber" type="string">
<column name="WorkPhoneNumber" />
</property>
<property name="creationDate" type="timestamp">
<column name="CreationDate" length="23" />
</property>
<property name="modDate" type="timestamp">
<column name="ModDate" length="23" />
</property>
<property name="modDescription" type="string">
<column name="ModDescription" />
</property>
<property name="passwordSetDate" type="timestamp">
<column name="PasswordSetDate" length="23" />
</property>
<property name="lastLoggedIn" type="timestamp">
<column name="LastLoggedIn" length="23" />
</property>
<set name="xcontractsForXuserBuyer" inverse="true">
<key>
<column name="XUserBuyer" precision="20" scale="0" />
</key>
<one-to-many class="no.xlink.hibernate.generated.XContract" />
</set>
<set name="xreportUserPrivs" inverse="true">
<key>
<column name="XUser" precision="20" scale="0" />
</key>
<one-to-many class="no.xlink.hibernate.generated.XReportUserPriv" />
</set>
<set name="xcontractsForXuserSeller" inverse="true">
<key>
<column name="XUserSeller" precision="20" scale="0" />
</key>
<one-to-many class="no.xlink.hibernate.generated.XContract" />
</set>
</class>
</hibernate-mapping>



Without optimistic locking.....
<?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 26.okt.2006 12:20:09 by Hibernate Tools 3.2.0.beta8 -->
<hibernate-mapping>
<class name="no.xlink.hibernate.generated.XUser" table="XUser" schema="dbo" catalog="devtest3">
<id name="pk" type="big_decimal">
<column name="PK" precision="20" scale="0" />
<generator class="assigned" />
</id>
<many-to-one name="xlocale" class="no.xlink.hibernate.generated.XLocale" fetch="select">
<column name="XLocale" precision="20" scale="0" />
</many-to-one>
<many-to-one name="xgroup" class="no.xlink.hibernate.generated.XGroup" fetch="select">
<column name="XGroup" precision="20" scale="0" />
</many-to-one>
<property name="isActive" type="java.lang.Integer">
<column name="IsActive" />
</property>
<property name="localUser" type="java.lang.Integer">
<column name="LocalUser" />
</property>
<property name="useHttps" type="java.lang.Integer">
<column name="UseHTTPS" />
</property>
<property name="loginName" type="string">
<column name="LoginName" />
</property>
<property name="password" type="string">
<column name="Password" />
</property>
<property name="description" type="string">
<column name="Description" />
</property>
<property name="userPrivileges" type="string">
<column name="UserPrivileges" length="6000" />
</property>
<property name="faxNumber" type="string">
<column name="FaxNumber" />
</property>
<property name="firstName" type="string">
<column name="FirstName" />
</property>
<property name="lastName" type="string">
<column name="LastName" />
</property>
<property name="emailAddress" type="string">
<column name="EmailAddress" />
</property>
<property name="mobilePhoneNumber" type="string">
<column name="MobilePhoneNumber" />
</property>
<property name="workPhoneNumber" type="string">
<column name="WorkPhoneNumber" />
</property>
<property name="creationDate" type="timestamp">
<column name="CreationDate" length="23" />
</property>
<property name="modDate" type="timestamp">
<column name="ModDate" length="23" />
</property>
<property name="modDescription" type="string">
<column name="ModDescription" />
</property>
<property name="passwordSetDate" type="timestamp">
<column name="PasswordSetDate" length="23" />
</property>
<property name="lastLoggedIn" type="timestamp">
<column name="LastLoggedIn" length="23" />
</property>
<set name="xcontractsForXuserBuyer" inverse="true">
<key>
<column name="XUserBuyer" precision="20" scale="0" />
</key>
<one-to-many class="no.xlink.hibernate.generated.XContract" />
</set>
<set name="xreportUserPrivs" inverse="true">
<key>
<column name="XUser" precision="20" scale="0" />
</key>
<one-to-many class="no.xlink.hibernate.generated.XReportUserPriv" />
</set>
<set name="xcontractsForXuserSeller" inverse="true">
<key>
<column name="XUserSeller" precision="20" scale="0" />
</key>
<one-to-many class="no.xlink.hibernate.generated.XContract" />
</set>
</class>
</hibernate-mapping>


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 26, 2006 7:19 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
i said tags not types

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 26, 2006 9:51 am 
Newbie

Joined: Mon Oct 23, 2006 6:54 am
Posts: 15
ok.. sorry :)
I did not find a timestamp tag
I found the version tag in this file... and it is removed if I set detectOptimisticLock="false"..
The Version column is nvarchar(-9) and is set to string in the reveng.xml
file (<sql-type jdbc-type="-9" hibernate-type="string"/>)

<?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 26.okt.2006 15:45:55 by Hibernate Tools 3.2.0.beta8 -->
<hibernate-mapping>
<class name="no.xlink.hibernate.generated.XMessageLog" table="XMessageLog" schema="dbo" catalog="devtest3">
<id name="pk" type="big_decimal">
<column name="PK" precision="20" scale="0" />
<generator class="assigned" />
</id>
<version name="version" type="string">
<column name="Version" />
</version>
<many-to-one name="xmessageLog" class="no.xlink.hibernate.generated.XMessageLog" fetch="select">
<column name="RefForwardPK" precision="20" scale="0" />
</many-to-one>
<many-to-one name="xgroupByXgroupSender" class="no.xlink.hibernate.generated.XGroup" fetch="select">
<column name="XGroupSender" precision="20" scale="0" />
</many-to-one>
<many-to-one name="xgroupByXgroupReceiver" class="no.xlink.hibernate.generated.XGroup" fetch="select">
<column name="XGroupReceiver" precision="20" scale="0" />
</many-to-one>
<property name="impOrExp" type="string">
<column name="ImpOrExp" />
</property>
<property name="messageDate" type="timestamp">
<column name="MessageDate" length="23" />
</property>
<property name="messageId" type="string">
<column name="MessageID" />
</property>
<property name="refMessageId" type="string">
<column name="RefMessageID" />
</property>
<property name="senderCode" type="string">
<column name="SenderCode" />
</property>
<property name="receiverCode" type="string">
<column name="ReceiverCode" />
</property>
<property name="numOfElements" type="java.lang.Integer">
<column name="NumOfElements" />
</property>
<property name="numOfBytes" type="java.lang.Integer">
<column name="NumOfBytes" />
</property>
<property name="transType" type="string">
<column name="TransType" />
</property>
<property name="receiveDate" type="timestamp">
<column name="ReceiveDate" length="23" />
</property>
<property name="statusReceive" type="java.lang.Integer">
<column name="StatusReceive" />
</property>
<property name="errorTextReceive" type="string">
<column name="ErrorTextReceive" />
</property>
<property name="xmlfile" type="string">
<column name="XMLFile" />
</property>
<property name="updateStartDate" type="timestamp">
<column name="UpdateStartDate" length="23" />
</property>
<property name="statusUpdate" type="java.lang.Integer">
<column name="StatusUpdate" />
</property>
<property name="numOfQueries" type="java.lang.Integer">
<column name="NumOfQueries" />
</property>
<property name="numOfChanges" type="java.lang.Integer">
<column name="NumOfChanges" />
</property>
<property name="updateFinishedDate" type="timestamp">
<column name="UpdateFinishedDate" length="23" />
</property>
<property name="logFile" type="string">
<column name="LogFile" />
</property>
<property name="errorTextUpdate" type="string">
<column name="ErrorTextUpdate" />
</property>
<property name="controlStatus" type="java.lang.Integer">
<column name="ControlStatus" />
</property>
<property name="controlMessage" type="string">
<column name="ControlMessage" />
</property>
<property name="errorTextControl" type="string">
<column name="ErrorTextControl" />
</property>
<property name="xmessageLog_1" type="big_decimal">
<column name="XMessageLog" precision="20" scale="0" not-null="true" />
</property>
<property name="mailStatus" type="java.lang.Integer">
<column name="MailStatus" />
</property>
<property name="errorTextMail" type="string">
<column name="ErrorTextMail" />
</property>
<property name="mailDate" type="timestamp">
<column name="MailDate" length="23" />
</property>
<property name="errorMailStatus" type="java.lang.Integer">
<column name="ErrorMailStatus" />
</property>
<property name="errorTextErrorMail" type="string">
<column name="ErrorTextErrorMail" />
</property>
<property name="errorMailDate" type="timestamp">
<column name="ErrorMailDate" length="23" />
</property>
<property name="exportStatus" type="java.lang.Integer">
<column name="ExportStatus" />
</property>
<property name="errorTextExport" type="string">
<column name="ErrorTextExport" />
</property>
<property name="externalref" type="string">
<column name="Externalref" />
</property>
<property name="sentStatus" type="java.lang.Integer">
<column name="SentStatus" />
</property>
<property name="errorTextSent" type="string">
<column name="ErrorTextSent" />
</property>
<property name="sentDate" type="timestamp">
<column name="SentDate" length="23" />
</property>
<property name="numOfSent" type="java.lang.Integer">
<column name="NumOfSent" />
</property>
<property name="modDate" type="timestamp">
<column name="ModDate" length="23" />
</property>
<property name="modDescription" type="string">
<column name="ModDescription" />
</property>
<property name="serverName" type="string">
<column name="ServerName" />
</property>
<property name="bodyVersion" type="string">
<column name="BodyVersion" />
</property>
<property name="messageType" type="string">
<column name="MessageType" />
</property>
<property name="status" type="java.lang.Integer">
<column name="Status" />
</property>
<property name="refPk" type="big_decimal">
<column name="RefPK" precision="20" scale="0" />
</property>
<property name="dependentOn" type="string">
<column name="DependentOn" />
</property>
<property name="dependencyText" type="string">
<column name="DependencyText" />
</property>
<property name="dependencyStatus" type="java.lang.Integer">
<column name="DependencyStatus" />
</property>
<property name="dependentOnFirstCheck" type="big_decimal">
<column name="DependentOnFirstCheck" precision="20" scale="0" />
</property>
<property name="onErrorRetry" type="java.lang.Integer">
<column name="OnErrorRetry" />
</property>
<property name="onErrorLastRetry" type="timestamp">
<column name="OnErrorLastRetry" length="23" />
</property>
<property name="forwardMessageType" type="string">
<column name="ForwardMessageType" />
</property>
<property name="forwardText" type="string">
<column name="ForwardText" />
</property>
<property name="forwardStatus" type="java.lang.Integer">
<column name="ForwardStatus" />
</property>
<property name="forwardUrl" type="string">
<column name="ForwardURL" />
</property>
<set name="xmessageLogActives" inverse="true">
<key>
<column name="XMessageLog" precision="20" scale="0" />
</key>
<one-to-many class="no.xlink.hibernate.generated.XMessageLogActive" />
</set>
<set name="xmessageLogs" inverse="true">
<key>
<column name="RefForwardPK" precision="20" scale="0" />
</key>
<one-to-many class="no.xlink.hibernate.generated.XMessageLog" />
</set>
</class>
</hibernate-mapping>


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 26, 2006 10:00 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
yes and nvarchar is not the type hibernate expects for a version column...thus disable auto optimistic lock check.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 26, 2006 10:23 am 
Newbie

Joined: Mon Oct 23, 2006 6:54 am
Posts: 15
Why did it pick the column named Version ? Is it because of the name of the column ?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 26, 2006 10:39 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
yes that is the "auto" part.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 26, 2006 10:45 am 
Newbie

Joined: Mon Oct 23, 2006 6:54 am
Posts: 15
Ok, not very auto :) And since the database is not made by me and I cant change it I just have to leave it off :)

Tanx for the help :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 15 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.