Hi Vincent, the main problem that you have is that you cannot define a foreign key that references TableA OR TableB.
Basically if you want to have database foreign keys (and if your OJB app is the only user of the database, then you don't need to, OJB handles the referencial integrity itself), then you basically have to define a common base class for your two classes which is mapped to a specific table, say TableAB.
From there you now have two options as to how to map the inheritance
onto tables. You can either map both classes completely to this table or let OJB use joins. If the two classes have a lot of database-mapped attributes in common, the first solution makes most sense, esp. performance-wise. If they are however quite different, you probably want the second option, which is explained in more detail here: http://db.apache.org/ojb/docu/guides/advanced-technique.html#Mapping+Each+Subclass+to+a+Distinct+Table+%28table+per+subclass%29 hope that helps, Tom --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
