ObjectDB ObjectDB

Question about overriding default equals and hashcode

#1

Hello Support,

I have overrided equals and hashcode method in my entities beans.

I don't know if you use these methods in your objectdb implementation. ( for comparing bean ? )
If yes, does it have an impact on performance of database ?

Regards,
Xirt
 

edit
delete
#2

ObjectDB does not usually use equals and hashCode of entity classes.

They could be used, however, if specified explicitly in a query (since ObjectDB supports user defined methods in queries as an extension to JPQL and JDOQL), when comparing collections in queries, etc.

ObjectDB Support
edit
delete
#3

Doing a "strings mydb.odb" give me some trace like that :

org.jvnet.jaxb2_commons.lang.Equals%

org.jvnet.jaxb2_commons.lang.HashCode%

org.jvnet.jaxb2_commons.lang.ToString

It correspond to my entity bean includes ( use JAXB ).

So why these informations are revelants to persistance of my beans ?

edit
delete
#4

ObjectDB doesn't store methods or methods names, but it stores field names and types, including static final, for using in queries when entity classes are not available (e.g. in the Explorer).

If JAXB adds fields to your classes, their names and types are stored in the ObjectDB schema.

ObjectDB Support
edit
delete

Reply

To post on this website please sign in.