|
From: <jue...@we...> - 2004-08-31 14:30:30
|
Indeed, the convenience operations on PersistenceBrokerTemplate are just =
a subset. Note that you can always implement your own =
PersistenceBrokerCallback, working with the raw PersistenceBroker. For =
example:
=20
Object myObject =3D getPersistenceBrokerTemplate().execute(new =
PersistenceBrokerCallback() {
public Object doInPersistenceBroker(PersistenceBroker pb) {
return pb.getObjectByIdentity(new Identity(...));
}
});
=20
This is particularly recommendable for operations that involve multiple =
interrelated PersistenceBroker calls. Any such callback will =
automatically participate in Spring's resource and transaction =
management, just like the convenience operations do.
=20
If there are further typical convenience operations that make sense on =
PersistenceBrokerTemplate itself, I'm open to adding them:
=20
* getReportQueryIteratorByQuery is an obvious candidate. I've just added =
it.
=20
* getObjectByIdentity does not seem to be intended for direct usage, =
according to the OJB javadocs. The main issue is: Where do you get the =
Identity parameter from? As this is unlikely to come in from the =
outside, it's probably appropriate to just use getObjectByIdentity as =
part of a sequence of calls within a PersistenceBrokerCallback.
=20
* getClassDescriptor seems like a method typically used as part of a =
larger sequence too, so also rather to be used within a =
PersistenceBrokerCallback.
=20
If I'm wrong in terms of the typical use cases for the latter two, feel =
free to try to convince me :-)
=20
Juergen
=20
=20
-----Original Message-----
From: spr...@li... =
[mailto:spr...@li...]On Behalf =
Of Clute, Andrew
Sent: Tuesday, August 31, 2004 4:06 PM
To: spr...@li...
Subject: [Springframework-developer] OJB PB Support: Why only partial?
Since the release of 1.1RC2, I have been attempting to retrofit Spring =
into my system and remove my EJB's. We make heavy use of OJB's =
PersistenceBroker API, and as such, I was hoping to utilize the =
PersistenceBrokerDaoSupport, with the PersistenceBrokerTemplate.=20
However, it seems that PersistenceBrokerTemplate only supports a subset =
of the methods that PB has on it, with the three major missing ones =
being findObjectByIdentity, getReportQueryIteratorByQuery and =
getClassDescriptor.
Was there a conscious decision to leave these methods out, or was it =
just an oversight/timing issue? I would be happy to implement these =
methods and submit the changes back to the group, but I wanted to =
confirm that there wasn't a specific reason for leaving these off.
Thanks!=20
-Andrew=20
|