You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by "Manukyan, Sergey" <SM...@lear.com> on 2006/01/20 14:34:31 UTC

store object without references

Folks,

I am using 1.0.4.

Could you please advice if there is a way to store an object of some
class without storing references although I defined in the descriptor of
the class to store references as well.

I am looking for a workaround that will enable me to do it in some
cases...

Something like:

PersistenceBroker.store(object, <some flag to indicate not to store
references>)

Thank you,

Sergey

**********************
** LEGAL DISCLAIMER **
**********************

This E-mail message and any attachments may contain
legally privileged, confidential or proprietary
information. If you are not the intended recipient(s),
or the employee or agent responsible for delivery of
this message to the intended recipient(s), you are
hereby notified that any dissemination, distribution
or copying of this E-mail message is strictly
prohibited. If you have received this message in
error, please immediately notify the sender and
delete this E-mail message from your computer.

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: store object without references

Posted by Armin Waibel <ar...@apache.org>.
Hi Sergey,

Manukyan, Sergey wrote:
> Folks,
> 
> I am using 1.0.4.
> 
> Could you please advice if there is a way to store an object of some
> class without storing references although I defined in the descriptor of
> the class to store references as well.
> 
> I am looking for a workaround that will enable me to do it in some
> cases...
> 
> Something like:
> 
> PersistenceBroker.store(object, <some flag to indicate not to store
> references>)

you can use a method defined in PersistenceBrokerInternal, simply cast 
the used PB instance to PBI.

public void store(Object obj, Identity oid, ClassDescriptor cld, 
boolean insert, boolean ignoreReferences)
This method will ignore the auto-update settings when flag 
'ignoreReferences' is true.

http://db.apache.org/ojb/api/org/apache/ojb/broker/PersistenceBrokerInternal.html

Build the Identity via IdentityFactory (service method in PB), lookup 
the ClassDescriptor via PB.

regards,
Armin


> 
> Thank you,
> 
> Sergey
> 
> **********************
> ** LEGAL DISCLAIMER **
> **********************
> 
> This E-mail message and any attachments may contain
> 
> legally privileged, confidential or proprietary
> 
> information. If you are not the intended recipient(s),
> or the employee or agent responsible for delivery of
> 
> this message to the intended recipient(s), you are
> 
> hereby notified that any dissemination, distribution
> 
> or copying of this E-mail message is strictly
> 
> prohibited. If you have received this message in
> 
> error, please immediately notify the sender and
> 
> delete this E-mail message from your computer.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org