-->
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.  [ 2 posts ] 
Author Message
 Post subject: Strange insert result
PostPosted: Sat Oct 23, 2004 5:22 pm 
Newbie

Joined: Tue Oct 12, 2004 10:28 am
Posts: 3
Hibernate version 2.1.6
Weblogic version 8.1.3
Oracle 8.1.7
Using oracle jdbc thin driver.
When create attachment, the parentID are floating number such as 2.53E-124, 1.46E56
Attachment attachment = new Attachment();
attachment.setName(name);
attachment.setType(Attachment.TYPE_DOC);
attachment.setLinkAlt(name);
attachment.setParent(article);
article.getAttachments().add(attachment);
session.save(attachment);

When runing on WebSphere, Tomcat, it's OK.
The mapping file is below.
<class name="com.gpower.services.content.entity.Article" table="CMS_ARTICLE" polymorphism="explicit">
<cache usage="read-write"/>
<id name="ID" type="long">
<generator class="increment"/>
</id>
<property name="parentID"/>
<property name="name"/>
<property name="status"/>
<property name="pubFlag"/>
...
<bag name="locations" table="CMS_CHANNEL_ARTICLE" inverse="true" lazy="true" cascade="all-delete-orphan">
<key column="articleID"/>
<one-to-many class="com.gpower.services.content.entity.Location"/>
</bag>
<bag name="relations" table="CMS_ARTICLE_RELATION" lazy="false">
<cache usage="read-write"/>
<key column="articleID"/>
<many-to-many class="com.gpower.services.content.entity.Content" column="relationID"/>
</bag>
<bag name="attachments" table="CMS_ATTACHMENT" inverse="true" lazy="true" cascade="all">
<cache usage="read-write"/>
<key column="parentID"/>
<one-to-many class="com.gpower.services.content.entity.Attachment"/>
</bag>
</class>

<class name="com.gpower.services.content.entity.Attachment" table="CMS_ATTACHMENT">
<cache usage="read-write"/>
<id name="ID" type="long">
<generator class="increment"/>
</id>
<property name="name"/>
<property name="filename"/>
<property name="type"/>
<property name="linkAlt"/>
<property name="srcFile"/>
<property name="fileExt"/>
<property name="creationDate"/>
<property name="modifiedDate"/>
<property name="owner"/>
<many-to-one name="parent" column="parentID" class="com.gpower.services.content.entity.Article"/>
</class>


Top
 Profile  
 
 Post subject: The problem is caused by Weblogic oracle jdbc driver
PostPosted: Sun Oct 24, 2004 1:59 am 
Newbie

Joined: Tue Oct 12, 2004 10:28 am
Posts: 3
Just add classes12.zip to classpath, load it first.


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