You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is Issue 156 moved from a Google Code project.
Added by 2010-11-24T11:35:49.000Z by [email protected].
Please review that bug for more context and additional comments, but update this bug.
Closed (Fixed).
Original labels: Type-Defect, Priority-Medium, v0.9.24
Original description
Error produced using Version 0.9.24-SNAP
<b>What steps will reproduce the problem?</b>
1. Create new ODatabaseGraph and open it.
2. Create an OClass (Entity) using schema api and save.
3. Create an OClass (Person) that inherits from above class (Entity) using schema api and save.
4. Create a vertex from OClass (Person) in step 3
5. Run query on database.
Runs as expected!
6. close database
7. Open same database
8. Create a vertex from OClass (Person) in step 3
9. Run query on database.
Fails with the following error:
Exception in thread "main" com.orientechnologies.orient.core.exception.OConfigurationException: Can't retrieve pojo from the record Person@8:0{name:Joe}
at com.orientechnologies.orient.core.db.ODatabasePojoAbstract.getUserObjectByRecord(Unknown Source)
at com.orientechnologies.orient.core.db.ODatabasePojoAbstract.getUserObjectByRecord(Unknown Source)
at com.orientechnologies.orient.core.db.ODatabasePojoAbstract.query(Unknown Source)
at test.Start.main(Start.java:44)
Caused by: com.orientechnologies.orient.core.exception.OGraphException: Unrecognized class: Person
at com.orientechnologies.orient.core.db.graph.ODatabaseGraphTx.newInstance(Unknown Source)
at com.orientechnologies.orient.core.db.graph.ODatabaseGraphTx.newInstance(Unknown Source)
at com.orientechnologies.orient.core.db.ODatabasePojoAbstract.getUserObjectByRecord(Unknown Source)
... 3 more
My code is below and also attached.
public class Start {
/**
* @param args
*/
public static void main(String[] args) {
String db_name = "/tmp/graph2/graph.db";
new ODatabaseGraphTx("local:" + db_name).create().close();
ODatabaseGraphTx database0 = new ODatabaseGraphTx("local:" + db_name);
database0.open("admin", "admin");
OClass entity = database0.getMetadata().getSchema().
createClass("Entity").setSuperClass(database0.getMetadata().
getSchema().getClass(OGraphVertex.class));
entity.createProperty("name", OType.STRING);
entity.save();
database0.getMetadata().getSchema().createClass("Person").
setSuperClass(database0.getMetadata().getSchema().getClass("Entity"));
database0.getMetadata().getSchema().save();
database0.createVertex("Person").set("name", "Joe").save();
database0.createVertex("Person").set("name", "Matt").save();
List<OGraphVertex> results = database0.
query(new OSQLSynchQuery<OGraphVertex>("select from Person") );
for (OGraphVertex oGraphVertex : results) {
System.out.println(oGraphVertex.get("name"));
}
database0.close();
ODatabaseGraphTx database1 = new ODatabaseGraphTx("local:" + db_name);
database1.open("admin", "admin");
database1.createVertex("Person").set("name", "Fred").save();
database1.createVertex("Person").set("name", "Mark").save();
List<OGraphVertex> results1 = database1.
query(new OSQLSynchQuery<OGraphVertex>("select from Person") );
for (OGraphVertex oGraphVertex : results1) {
System.out.println(oGraphVertex.get("name"));
}
database1.close();
}
}
The text was updated successfully, but these errors were encountered:
This is Issue 156 moved from a Google Code project.
Added by 2010-11-24T11:35:49.000Z by [email protected].
Please review that bug for more context and additional comments, but update this bug.
Closed (Fixed).
Original labels: Type-Defect, Priority-Medium, v0.9.24
Original description
The text was updated successfully, but these errors were encountered: