Again, a bad title.
I've the following problem:
CREATE TABLE Rules ( id int, ... )
CREATE TABLE RulesObjects ( id int, ruleid int, object_type int, object_id);
Rules can be spesified on several types of objects. What I want to happen is that when I load the object, it would also load the collection of rules.
The problem is that the object_id may not be unique across objects.
I don't know what I should use here, a where clause that specify which object type to limit this to or try to use a composite key somehow.
Any suggestion about the recommended approach?
|