-->
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.  [ 8 posts ] 
Author Message
 Post subject: Generate POJOs from a limited set of tables using eclipse
PostPosted: Fri May 27, 2005 3:13 pm 
Newbie

Joined: Thu Dec 11, 2003 3:27 pm
Posts: 12
In the eclipse plugin's Hibernate Artificact Generation wizard I don't see any option for generated mappings and POJOs for a specified set of tables. In fact, there's not even an option for restricting generation to tables from a particular schema. That causes my attempt at code generation to fail with a message like this: "Column(XXX already exists in Table(null.xxxx)" The reason for that error is that in my workplace our database instance houses qa and dev versions of our table structure, and so every Table, including Table XXX, appears in both schemas.

So is there some way to limit code generation to a limited set of tables?


Top
 Profile  
 
 Post subject:
PostPosted: Sat May 28, 2005 4:26 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
in alpha 1/2 set default schema/catalog

in cvs version use a .reveng.xml to limit it.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: Generate POJOs from a limited set of tables using eclipse
PostPosted: Tue May 31, 2005 3:21 pm 
Newbie

Joined: Thu Dec 11, 2003 3:27 pm
Posts: 12
I don't see 'set default/schema catalog', or anything like it, in any of the three eclipse Hibernate wizards in alpha1. Where do I set the schema? (By the way, you mention alpha2, but the downloads page only shows alpha1. Is there an alpha2 available?)


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 31, 2005 4:49 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
jbosside downloads contain alpha2

default schema-catalog is as always with hibernate specfified in the hibernate.cfg.xml

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 08, 2005 4:36 pm 
Newbie

Joined: Mon Jan 17, 2005 5:59 pm
Posts: 6
Location: Canada
Max,

I'm not sure if the entire original question was answered. Can the Artifact Generation Wizard be configured so that only a subset of tables from a schema are generated?

Middlegen allows this type of functionality. Before I upgrade to Hibernate 3.0 and use the Artifact Generation Wizard, I need this functionality. Sometimes, a database schema contains tables that don't have primary keys, etc. and I would like to leave those out of the reverse engineering process. It is also useful if the database is large.

Stefanie


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 08, 2005 4:40 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
Yes.

http://www.hibernate.org/hib_docs/tools ... .html#gen9

http://www.hibernate.org/hib_docs/tools ... lpha4.html

(See under Wizard section - here you can specify the .reveng.xml documented in the first link)

-max

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 08, 2005 4:45 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
And note in middlegen you had to specify every table (which I found a pain) or take it all.

In the reveng.xml you can setup table-filter to include/exclude what you want - IMO much more effective for large schemas.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 08, 2005 4:48 pm 
Newbie

Joined: Mon Jan 17, 2005 5:59 pm
Posts: 6
Location: Canada
Cool. Thanks for your prompt response. I will take a look. I only had 3.0 alpha 1 version as per what was posted on the tools.hibernate.org site. I see that 3.0 alpha 4 is there now.

Stefanie


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