v1.7
I'm doing some sample coding in preparation for an upcoming project and am 
trying to use class inheritance with the Document model along with 
clusters.  I have not found a good documented example of using clusters 
through the API, so I can't say for sure I'm doing this right, but here is 
my scenario.  I have a parent class called "AuditLog" and a child called 
"PersistenceAuditLog" that I would like to store in the same cluster.  My 
attempt was to store information in a "daily cluster" with these two (and 
others later) classes.  Is this possible?

      OClass auditClass = 
database.getMetadata().getSchema().createClass("AuditLog");
      auditClass.addCluster("today");
      auditClass.addCluster("yesterday");
      auditClass.createProperty("id", OType.STRING);
      auditClass.createProperty("username", OType.STRING);
      auditClass.createProperty("timestamp", OType.DATETIME);
      auditClass.createProperty("module", OType.STRING);

      OClass persistenceAuditClass = 
database.getMetadata().getSchema().createClass("PersistenceAuditLog", 
auditClass);
      persistenceAuditClass.addCluster("today");
      persistenceAuditClass.addCluster("yesterday");
      persistenceAuditClass.createProperty("object_type", OType.STRING);
      persistenceAuditClass.createProperty("operation", OType.STRING);
      persistenceAuditClass.createProperty("old_value", OType.ANY);
      persistenceAuditClass.createProperty("new_value", OType.ANY);


-- 

--- 
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/d/optout.

Reply via email to