"Type Card cannot be serialized because is not part of registered entities. To fix this error register this class"
db.getEntityManager().registerEntityClasses( Card.class );
"The method registerEntityClass (Collection <String>) in the type OEntityManager is not applicable for the arguments ( Class<Card> )"
Before to use persistent POJOs OrientDB needs to know which classes are persistent (between thousands in your classpath) by registering the persistent packages and/or classes. Example:
database.getEntityManager().registerEntityClasses("com.orientechnologies.orient.test.domain");This must be done only right after the database is created or opened.
public class Card
{
private String name;
private int cost;
private int strength;
public Card () {}
public String getName ( ) { return name; }
public void setName ( String value ) { name = value; }
public int getCost () { return cost; }
public void setCost ( int value ) { cost = value; }
public int getStrength () { return strength; }
public void setStrength ( int value ) { strength = value; }
}