-->
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.  [ 1 post ] 
Author Message
 Post subject: hibernate exception but everything works as it should
PostPosted: Sun Aug 16, 2009 5:43 pm 
Newbie

Joined: Sun Aug 16, 2009 5:07 pm
Posts: 2
Hi all,

firstly sorry for my english.

I have a strange exception from hibernate
Code:
java.sql.BatchUpdateException - Column 'produitId' cannot be null

but this produitId is inserted correctly in the database


Here is my mapping xml
Code:
<class name="entity.Produit" table="produits">
         <id name="id">
            <generator class="native" />
         </id>
         <property name="prix" />
         <property name="disponibilite" />
         <property name="nbrImage" />
         <property name="reduction" />
         <property name="produitTaille" />
         <property name="produitCouleur" />
         <set name="produitInfo" lazy="false" cascade="all">
            <key column="produitId"/>
            <one-to-many class="entity.ProduitInfo" />
         </set>
   </class>
   
   <class name="entity.ProduitInfo" table="produitinfo">
         <composite-id>
            <key-property name="produitId"/>
            <key-property name="langueId"/>
         </composite-id>
         <property name="titre" />
         <property name="description" />
   </class>


Class Produit has a SET produitInfo and everything works normally but in the end it generate this exception.

thanks.


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

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.