Marcus Young wrote:

Thanks Tom - the test cases against role and group now function correclty. The record id's appear to be unique across the extent set?

Depends on how you get their values. A simple MySQL-style autoincrement in the database won't work, but if you're letting OJB create the values, or if you have a database sequence defined for it, then you should be fine.


Interestingly however, no data is actually written to the 'permission_holder' table - this includes the permisison holder id and any test attributes that are added to the permission holder class. This started me thinking about the possibility of a class-descriptor that defines a class that has no direct map to a database table. This descriptor would only contain information detailing relationships between other class-descriptors. I'm fairly new to this, so I not sure if this makes sense?!

Mapping an inheritance hierarchy to multiple tables is a somewhat involved topic. If you haven't checked already, you should look here for some details:


http://db.apache.org/ojb/docu/guides/advanced-technique.html#Mapping+Classes+on+Multiple+Joined+Tables

Basically you need references that use the special keyword 'super' to referer to the base instance.

It would be a lot easier if you were able to map all subclass of PermissionHolder to the same table, because in this case you'll only need an additional field 'ojbConcreteClass' that tells OJB which class to instantiate when reading a row from the table.

Tom


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to