-->
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: Hibernate Tools - rev eng foreign keys that aren't there?
PostPosted: Fri Aug 13, 2010 11:40 am 
Newbie

Joined: Tue Oct 02, 2007 12:47 am
Posts: 3
Hi,

I was wondering if it's reasonably possible to use Hibernate Tools, specifically the reverse engineering mapping generation, to create mapping files that have many-to-one and one-to-many associations for tables that don't actually have foreign keys defined in the database. I don't have control over the database and the foreign keys were never created there. However, the database does have "implied" foreign keys, which means it has a certain "template" for columns that are treated like foreign keys. For example, table A and table B are related, but there is no explicit foreign key defined. However, table A has columns YYY_B and ZZZ_B. Table B has columns YYY and ZZZ, which comprise the primary key. So, based on the naming convention of the columns, can I use hibernate tools reverse engineering custom strategy to create mapping files that have the appropriate many-to-one mapping? I would also be looking to use wildcard features since there are hundreds of tables in the schema that use the same naming convention; I don't want to have to write a strategy file for each table...rather, I'd like to setup some kind of wildcard/template scheme that handles all tables in the schema.
Thanks...


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.