openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Frederic_Bell...@capgroup.com
Subject OpenJPA subclasses overwrite toString() - why?
Date Thu, 03 Apr 2008 17:40:04 GMT

About the OpenJPaID class:

The openjpaId class has a method to output a nice format key.toString()
which is type+objectId. This method has been overwritten by children
classes. Why is this?
The overwritten method only outputs the objectId and therefore is not
convenient when looking into the cache. Can this be reversed?

Even the logging output is not useful with only the objectId (think about
saving multiple object from a graph with same int value for PK - in such a
case the output does not say which class was saved properly or not.

An alternative is to use a nice String as the key for the cache but this is
not efficient compare to using the hashcode of OpenJpaId. So I guess this
is not a good option.

Can we get rid of the toString() method on all subclass of OpenJPAId?


F


Mime
View raw message