Hi Tino,
Tino Schöllhorn wrote:
Hi,
I have a situation where I want to prevent the creation of an object in
the database. Is there a way to prevent the insertion via the
callback-methods (beforeInsert....) ? Throwing an Exception in these
methods doesn't work, because the situation is not an error and I want
to prevent the change of client code.
Could you describe more detailed the situation? If you don't want to
create an object why do you call PB.store(...)?
If that is not possible should I extend the PersistenceBrokerImpl and
change the
PB.store(Object,Identity,ClassDescriptor, boolean, boolean) method
accordingly?
This will be possible. You can introduce a custom-attribute "readonly"
and declare it in the class-descriptor.
<attribute attribute-name="readonly" attribute-value="true"/>
file:///E:/dev/db-ojb-1b/ojb/doc/docu/guides/repository.html#custom+attribute
In PB.store you can check the custom-attribute with:
String result = cld.getAttribute("readonly");
regards,
Armin
I am glad for any
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]