Question about overriding default equals and hashcode


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 ?



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
ObjectDB - Fast Object Database for Java (JPA/JDO)

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




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

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


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
ObjectDB - Fast Object Database for Java (JPA/JDO)

Post Reply

To post a reply and/or subscribe to update notifications - please login