-->
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: Correct usage @hibernate.map from XDoclet
PostPosted: Mon Sep 26, 2005 9:21 am 
Beginner
Beginner

Joined: Mon Sep 22, 2003 5:18 am
Posts: 28
Does anyone can share correct example with @hibernate.map and all its related tags usage with description?

I want to use XDoclet to generate one-to-many relationship using map. My own version of mapping usage is similar to the following:



Code:
....
    * @hibernate.map
    *       cascade = "all"
    *
    * @hibernate.key
    *       column = "parentId"
    *
    * @hibernate.map-key
    *       column = "someChildProperty"         
    *       type = "java.lang.String"
    * 
    * @hibernate.one-to-many
    *       class = "com.my.Item"

   public Map getItems()
   {
      return items;
   }
...


But while persisting newly created entity with pre-populated map i got 'foreign key contraint voilation' errors.


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.