-->
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.  [ 5 posts ] 
Author Message
 Post subject: How-to limit || select specific schemas in <session-facto
PostPosted: Fri Jan 06, 2006 12:21 pm 
Regular
Regular

Joined: Sat Nov 06, 2004 5:20 pm
Posts: 54
Location: Collierville, TN
I'm using Tools version 3.1.0b2, connecting to db2/400. I want to create a hibernate.cfg.xml file and specifically state which schemas & tables I want in my session-factory(SF).

Is this possible? How-to? Example please...

I'm aware that I can define "a" hibernate.default-schema.
I'm aware that I can add "a" schema to the end of the hibernate.connection.url.
I'm aware that I can use filters in the reveng.xml (too late in the process - SF will already be populated).

Again, what I'd like to do is explicitly state which schemas & tables I'd like in the SF.

Thanks in advance.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 06, 2006 12:37 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
Are you sure you are talking about SessionFactory and not just about which tables will be reverse engineered ? Then using a reveng.xml or default schema should just work.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 06, 2006 4:23 pm 
Regular
Regular

Joined: Sat Nov 06, 2004 5:20 pm
Posts: 54
Location: Collierville, TN
OK, baby steps (for my sake). Oh, and I'm talking specifically working in the Hibernate Configuration Perspective(HCP).

#If I create a hibernate.cfg.xml file, I can specify at most one schema (either by setting the url or default schema).
#Next, if I create a hibernate configuration based on said hibernate.cfg.xml with either the url or default schema set - I'm good.
#Problem is, in the HCP after clicking +database, I'd like to view more than one schema.

</stay-with-me>

#If I create a hibernate.cfg.xml and don't specify a url or default schema...
#Next, I create a hibernate configuration based on said hibernate.cfg.xml...
#Problem is, in the HCP after clickin +database, I get back a host of stuff that I don't want || need.

Quote:
Actually, since I don't have permission to some schema's/tables, exceptions are thrown and I only get what the metadata processing has to that point. Not good.
</still-with-me?>

I might be way off base, but I'm thinking if I could somehow explicitly state in the hibernate.cfg.xml or in hibernate.properties the N schemas I want to view in the HCP (under +database) then I'd be golden.

That way I could still reveng and use table-filter to drill down further if needed.

Does that make any scence? I think the answer is to just use Ant - but I want to be a lazy pragmatic programmer and use the HCP with all the automation :-).


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 07, 2006 3:22 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
The database node in HCP is not filtered by the reveng.xml. It might be in the future.

The reveng.xml is only active when doing reverse engineering.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 09, 2006 11:48 am 
Regular
Regular

Joined: Sat Nov 06, 2004 5:20 pm
Posts: 54
Location: Collierville, TN
Filtering the db node based on reveng.xml would do the trick.

Currently, my issue happens before I click
Code:
Run, Hibernate Code Generation..., etc...
which creates reveng.xml.

The db node is either loaded with:
(a) the one schema structure I can define (via url or connection)
- or -
(b) the entire database structure (which tanks because of permission problems)

(a) and (b) are based on configs in hibernate.cfg.xml. That's why I thought I may have been missing something I could use to filter via the cfg.xml.

Anyhow, I'll move on. Looks like this one is specific to my case.


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