db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From oliver.m...@ppi.de
Subject RE: retrieve object inside delete
Date Mon, 03 Nov 2003 16:59:32 GMT
Hello,

> -----Original Message-----
> From: Armin Waibel [mailto:armin@code-au-lait.de]

> correct me if I'm wrong:
> You lookup a proxy object and then call
> broker.delete(proxyObject)
> right?

No.  I instantiate a self-written proxy class
and then call broker.delete(p).  I know that 
the standard usage is different.

> I assume the select statement is the result of
> 
> obj = ProxyHelper.getRealObject(obj);

correct.

> How can we avoid this? Assume the proxy object
> reference other objects and all have auto-delete 'true'...

Assume obj is of type Car and Car has a 1:n-mapped 
collection of Wheel with auto-delete='true'.

Then it would be great to generate:

DELETE FROM WHEEL WHERE car_id=<XYZ>
DELETE FROM CAR WHERE id=<XYZ>

No SELECT is necessary to determine the WHEEL-rows to delete.
But I realize that this is not easy.

> oliver.matz@ppi.de wrote:

> > IMHO it is not possible with OJB to delete an object
> > without rertieving it before.
> > 
> > I tried to instantiate a Proxy x and then call
> > PersistenceBrokerImpl.delete(x),
> > but this results in two statements: 
> > 
> > SELECT ... FROM XTABLE WHERE UID=4711
> > DELETE FROM XTABLE WHERE UID=4711
> > 
> > obviously, the first statement is superflous.

Regards,
  Olli

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


Mime
View raw message