-->
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.  [ 7 posts ] 
Author Message
 Post subject: failure : session.save();
PostPosted: Wed Jul 14, 2004 1:25 am 
Newbie

Joined: Wed Jul 14, 2004 1:18 am
Posts: 2
ENV :
Jbuilder Weblogic+JNDI MySQL

Code :
Transaction tx = session.beginTransaction();
User newUser = new User("Mike");
session.save(newUser);
Sytem.out.println("Mike id :"+newUser.getId());
tx.commit();

Jbuilder says : Mike id : 4028808cfdbbe1ad00fdbbe1b2620002

database has got a new item with a void column of name;

What's the problem?


Top
 Profile  
 
 Post subject: Hibernate says :
PostPosted: Wed Jul 14, 2004 1:33 am 
Newbie

Joined: Wed Jul 14, 2004 1:18 am
Posts: 2
Hibernate: insert into user (id) values (?)

thank u.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 19, 2004 5:46 am 
Beginner
Beginner

Joined: Mon Jul 19, 2004 4:55 am
Posts: 34
hello,
I have th same problem than yours.
I have an exception when I try to save my record.
It seems that hibernate can't find values...???
do you resolve this problem? if yes, can you say me what it's wrong?
thanx


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 19, 2004 8:13 am 
Regular
Regular

Joined: Tue Oct 28, 2003 8:25 am
Posts: 72
Location: Belgium
Please post java code + xml mapping of your user class.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 19, 2004 8:14 am 
Beginner
Beginner

Joined: Mon Jul 19, 2004 4:55 am
Posts: 34
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping
package="org.hibernate.auction">

<class name="User">
<id name="id" type="long" unsaved-value="null">
<generator class="native"/>
</id>
<property name="userName" not-null="true"/>
<property name="password" column="`password`"/>
<property name="email"/>
<component name="name">
<property name="firstName"/>
<property name="initial" column="`initial`"/>
<property name="lastName"/>
</component>
<bag name="bids" lazy="true" inverse="true" cascade="save-update">
<key column="bidder"/>
<one-to-many class="Bid"/>
</bag>
<bag name="auctions" lazy="true" inverse="true" cascade="save-update">
<key column="seller"/>
<one-to-many class="AuctionItem"/>
</bag>
</class>

</hibernate-mapping>


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 19, 2004 8:58 am 
Regular
Regular

Joined: Tue Oct 28, 2003 8:25 am
Posts: 72
Location: Belgium
Please also post the java code...


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 19, 2004 9:12 am 
Beginner
Beginner

Joined: Mon Jul 19, 2004 4:55 am
Posts: 34
thanx but I found...
it was the mysql connector version.
I used version 2 instead of 3.0
I changed my connector and it's run !!
thanx again


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