Regarding schema creation for Document type database

25 views
Skip to first unread message

Rohitdev Kulshrestha

unread,
Sep 25, 2015, 7:23:59 AM9/25/15
to OrientDB
Hi,

I have a certain data predefined model which i need to use to create a schema in the Document database.

I'm planning to use Orient in hybrid/mixed mode i.e.e schema+schema-less

How do i quickly define the schema for the DB.

I found in the documentation i have to use ODatabaseDocumentTx functions getMetadata().getSchema() to define individual classes and their properties via the  OClass object.

Is there a way i can do scan a package and auto create the models?

Can i use the below method safely as object Db is just a wrapper over the document db?

OObjectDatabaseTx db = new OObjectDatabaseTx(
"remote:localhost:2424/DB").open("root", "password");
db.getEntityManager().registerEntityClasses(
"com.demo.persistence.model");
Regards,
Rohitdev



alessand...@gmail.com

unread,
Oct 1, 2015, 3:57:49 AM10/1/15
to OrientDB
Hi,
see the attachments, I hope that they can be useful for you

Alessandro
ClassFinder.java
Main.java
Reply all
Reply to author
Forward
0 new messages