Hi all.

I'm a orientdb noob

I found a problem with the following code

...
database.setAutomaticSchemaGeneration(true);
final Collection<OClass> odbClasses = 
database.getMetadata().getSchema().getClasses();
database.getEntityManager().registerEntityClasses("my.domain.classes.package");

database.getMetadata().getSchema().synchronizeSchema();
final Collection<OClass> schemaFullClasses = 
database.getMetadata().getSchema().getClasses();

schemaFullClasses.removeAll(odbClasses);

...

The last line of code does not work because of an inconsistence between 
OClassImpl equals and hashcode behavior.
Different instances of OClass that are equal based on equals method have 
different hash codes.
The equals method is based on name filed equality, but hash code method 
makes use of the owner and document fields.
I think the problem may be in the hash code of th ODocument class

  @Override
  public int hashCode() {
    if (_recordId.isValid())
      return super.hashCode();

    return System.identityHashCode(this);
  }

where the calculation change based on the recordId validity.

Is it a bug, or there is something wrong in my way of using the OClass 
instances or Orientdb in general?

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to