Hi
folks,
I've just
encountered a small problem concerning the implementation of a method that
returns the entity instance with the greatest id.
ejbHomeRetrieveByMaxId().
Basically my entity
bean only has a remote interface at the minute which is proving to be the
problem. I was using an ejbSelect method to
retrieve all the
instances of the entity bean, ascendingly ordered by the primary key (a long
primitive).
If I'm correct and
please set me straight if I'm not, the ejbSelect method doesn't actually return
a set of localHome objects but instead returns a set
containing all the
primaryKeys for all the entities.
By this logic then
if I retrieve the long value of the first element in the set then I'll have the
max id. By returning this value in the remote call shouldn't
the container
interrupt the call take the primary key value and then return the remote
EJBObject corresponding to this primary key?
I'm not sure how
feasible it sounds but what I'm wondering is whether or not there's a
restriction on implementations of remote finder methods using
ejbSelect
methods?
Is it incorrect
practice for an entity bean to have both a remote and local set of
interfaces?
Is the container
able to distinguish when to return the appropriate interface?
Am I going about
this the wrong way altogether?
Thanks,
Mark.