Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
3.1rc2
I am looking for an example of a non-trivial usage of <formula> in a <many-to-one> mapping. The examples in the doc or the hibernate test cases are just constants.
In the formula I need to to use a combination of joins and calls to PL/SQL functions, but that is not possible because hibernate qualifies all my strings with the table name. Example:
Code:
<many-to-one name="primaryKeyColumnDefinition"
class="bootdb.ColumnDefinition">
<formula >
SELECT pk_column.impo_id
from key_constraint primary_key
,key_constraint_column pk_concol
,column_definition pk_column
WHERE primary_key.impo_id_reldf = impo_id
AND pk_concol.impo_id_kcon = primary_key.impo_id
AND pk_concol.impo_id_coldf = pk_column.impo_id
</formula>
</many-to-one>
renders to something like:
Code:
SELECT pk_column.impo_id
from relationde0_.key_constraint relationde0_.primary_key
,relationde0_.key_constraint_column relationde0_.pk_concol
,relationde0_.column_definition relationde0_.pk_column
WHERE primary_key.impo_id_reldf = relationde0_.impo_id
AND pk_concol.impo_id_kcon = primary_key.impo_id
AND pk_concol.impo_id_coldf = pk_column.impo_id
as formula0_ from RELATION_DEFINITION relationde0_ where (relationde0_.NAME='foo')
How can I convince hibernate not to qualify the table names? I tried all kinds of quotes, and it did not work.
Thanks,
Calin