Hi!
marc fleury wrote:
> In the case that the developer supplies a ComplexPK (aggregate of fields),
> currently, we have no other choice but to rely on the hashCode and equals
> that it supplies to do our internal EJB cuisine.
>
> does the spec say that you should overwrite hashCode and equals??? I don't
> think so...
As Dan pointed out, this is in the spec.
> all because the developer didn't specify an overriding hashCode and equals
> in his PK.
Add stuff to the Verifier to check if equals and hashCode is
implemented.
> in jboss1.0 I had solved it in the following fashion:
> every EJBObject (session or entity) had a unique identifier (creation time)
> and that "EjbossPrimaryKey" was a wrapper for the "real" Object
> dataBasePrimaryKey (could be a complex PK I didn't care )...
> the end result is that we *never* miss a cache hit, even if the developer
> did not supply hashCode and equals. Also we are *certain* that the stuff is
> fast since we provide the hashCode for the wrapper...
>
How do you ensure a unique identifier?
Also, remember that the mapping between real PK and jBoss PK must be
persistent. With CMP we can simply add it as a column, but how do you
intend to solve this for BMP??
> no offense, but clearly a superior design :))
That remains to be seen. I will be impressed if you have decent answers
for the above show-stoppers. ;-)
> Listen Rickard, I will rewire this, but it might be deeper than we think (I
> basically need to retool the way the lookups are done everywhere :((()
As usual, don't rewire until we know it is a good thing to do...
/Rickard
--
Rickard �berg
Email: [EMAIL PROTECTED]
http://www.telkel.com
http://www.jboss.org
http://www.dreambean.com