-->
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.  [ 3 posts ] 
Author Message
 Post subject: Collection mapping in revers enginering
PostPosted: Wed Jul 08, 2009 7:54 am 
Newbie

Joined: Tue Jul 07, 2009 11:24 am
Posts: 1
Hi,
Im i have oracle database 10g, and му goal is to build sources of java POJO classes via hbm2java. I'm trying to do it via revers enginering from database - to POJO. The pojo classes, has been correctly built , but by default the ralationship manytomany and onetomany are maped as: java.util.Set<?> for example:

private Set<Document> documentsForMotherId = new HashSet<Document>(0);

,but i need it to be mapped as java.util.Collection<?>:
@ManyToMany(mappedBy = "personCollection1")
private Collection<Document> documentCollection1;


and without initial initialisation
Is there possibility to adjast hibernate.reveng.xml to make such generation of POJO sources ?


Top
 Profile  
 
 Post subject: Re: Collection mapping in revers enginering
PostPosted: Thu Oct 29, 2009 9:13 am 
Senior
Senior

Joined: Tue Aug 04, 2009 7:45 am
Posts: 124
Map the property with the following meta-attributes:
<meta attribute="property-type">java.util.Collection</meta>
<meta attribute="default-value">null</meta>


Top
 Profile  
 
 Post subject: Re: Collection mapping in revers enginering
PostPosted: Tue Nov 17, 2009 10:20 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
why do you need no init and just Collection ? Hibernate will use a hashset anyway ?

_________________
Max
Don't forget to rate


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