Thomas,
I get this:
PersistenceBroker broker = null;
broker = PersistenceBrokerFactory.defaultPersistenceBroker();
ClassDescriptor cd = broker.getClassDescriptor( HomeBO.class );
ObjectReferenceDescriptor ord =
cd.getObjectReferenceDescriptorByName(???);//??? because there is no
explanation in the API as to WHICH name we need to use.
ord.setCascadeRetrieve(false);
The question is that if I'm using ODMG and I open my DB with:
...
db = odmg.newDatabase();
db.open( DBC , Database.OPEN_READ_WRITE );
...
will the PersistenceBrokerFactory.defaultPersistenceBroker(); return
anything at all?
Second where I have the ??? the API has no documentation on what String
value it's looking for (name has not description), but from the
description of the class I'm guessing that it wants to know WHICH
reference of the foreign-key who's attribute I want to assign to ord
and then set its Cascade type to false... Is that correct???
I obviously haven't tested this yet so...
If my assumptions above are all correct, then my feature request for
future version is to have a method which can apply Cascade types across
the board for the whole ClassDescriptor and its related classes. I
think the way you have above is fine for now, but can be quite
cumbersome on tables with a lot of inverse foreign keys. (that's
assuming I understood where you were sending me)
The reason I want to do this is, by the way, is because based on the
user role in the application, I want to have the select update and
delete behave different ways. For example if the user's role is DBA,
then I want everything on and allow the DBA to cascade a delete if they
want to, but if it's Joe User, then I don't even want to give them that
option and have the default set to no in the repository files.
R
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
- auto-update, auto-delete set dynamically? Robert S. Sfeir
- RE: auto-update, auto-delete set dynamically? Mahler Thomas
- RE: auto-update, auto-delete set dynamical... Ricardo Tercero Lozano
- Re: auto-update, auto-delete set dynamical... Robert S. Sfeir
- Re: auto-update, auto-delete set dynam... Thomas Mahler
- Re: auto-update, auto-delete set d... Robert S. Sfeir
- Re: auto-update, auto-delete set dynam... Armin Waibel
- Re: auto-update, auto-delete set d... Robert S. Sfeir
