Supposed I have
        OObjectDatabaseTx db = getDb();
        db.setAutomaticSchemaGeneration(true);     
        db.getEntityManager().registerEntityClasses("domain.model");

In the first run the schema gets correctly created, also new POJOs are 
added in next runs. However when I add new field to existing POJO, schema 
doesn't get updated. 

My idea was to drop the class and recreate it

OSchemaProxyObject schema = Orient.get().getDb().getMetadata().getSchema();
schema.reload(); // looks like empty class get registered in schema here
schema.generateSchema(type);
Orient.get().getDb().getEntityManager().registerEntityClass(type); // maybe 
don't need

Which actually works as expected. Except all objects of the type gets 
deleted. 
There is 
schema.synchronizeSchema();
but it doesn't create properties.

That brings question if there is support for schema refactoring while 
preserving data ?



           


-- 

--- 
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