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