-->
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: Generate unidirectional pojos only
PostPosted: Thu Jun 07, 2007 6:08 am 
Regular
Regular

Joined: Wed Nov 01, 2006 2:17 pm
Posts: 78
Hi,

I am using hibernate tools to generate all my pojos and mapping files from a database schema.

Unfortunately, all my pojos whose primary keys are foreign keys to other tables were provided with Sets. I don't want to have those in there. So I guess I have to find a way to generate unidirectional pojos instead of bidirectional ones.

How to configure this? Within my own ReverseEngineeringStrategy-class (what especially)? Within my reveng.xml configuration? Where else?

Thanks in advance!


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 07, 2007 7:33 am 
Regular
Regular

Joined: Wed Nov 01, 2006 2:17 pm
Posts: 78
Code:
   @Override
   public boolean excludeForeignKeyAsCollection(String arg0, TableIdentifier arg1, List arg2, TableIdentifier arg3, List arg4) {
      return true;
   }


I tried this one but the result is, that there are NO Sets at all in entities, which have many-to-many relationships.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 07, 2007 10:31 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
I guess it makes sense to make those TableIdentifier true Table's so you could call out to isManyToMany(Table).

Put it in jira with ref to this one.

_________________
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.