Hi,
 
I have a legacy table storing multiple types of lookup objects, here's the 
table description:
T_Lookup{ Id (key), object_type, object_id, description}
Where Id is table key and the object_id is the unique key per the object 
type.
All other tables use object_id as a foreign-key column and have no direct 
use of the id column of this table.
So I tried mapping a Country lookup class from this table using object_id as 
the key column, and defined the following where: "object_type=10".
 
While this works for direct queries, when I try to query over a different 
class that has a references association to this Country class it failes.
Looking at the sql the query generated I see the Country where 
(object_type=10) is not used hence the association is not unique.
 
Does the where attribute support associations? if so, what is the right way 
of doing it?
Thanks!

Reply via email to