[2.0.3] Register Entity Classes

23 views
Skip to first unread message

Андрей Гришин

unread,
Feb 23, 2015, 7:57:31 AM2/23/15
to orient-...@googlegroups.com
Hello!

I little bit confused while trying to register my entities classes.

I have my POJOs structure, which i need to bind, like this:

public class SliderEntity extends OEntity {
private double min;
private double max;
private double value;
private String style;
private transient BigDecimal trans;
...
}

public class ODateSignature {
private Date datetime;
...
}

@Entity
public abstract class OEntity {
private String name;
@Embedded
private ODateSignature signature;
@Embedded
private List<OEntity> versions;
@OVersion
private Object version;
...
}

Next step i connected to database and tried to:

database.setAutomaticSchemaGeneration(true);
database.getEntityManager().registerEntityClass(SliderEntity.class);

...and then, when i tried to save my object, i've got error:

com.orientechnologies.orient.core.exception.OSerializationException: Linked type [class org.orient.store.object.ODateSignature:23.02.15 12:16] cannot be serialized because is not part of registered entities. To fix this error register this class

As i inderstood next, i can try to do:

database.setAutomaticSchemaGeneration(true);
database.getEntityManager().registerEntityClasses(SliderEntity.class, true); // register my entities recursively

but after this, apart from error above, saving my object occurs in issue, where i have database scheme structure like this:

So, i saw that transient field "trans" was registered, which i really do not need to store in database, and also my ODataSignature still was not registered for binding.
Please, tell me, am I understand something wrong or this are bugs?

Thanks,
Andrey


Reply all
Reply to author
Forward
0 new messages