Hello,

I have a issue saving extended classes with OObjectDatabaseTx, I know that 
for each class you want to save you need to register it before you saved it 
and there should not be transactions opened to register it. Well the way I 
want to behave is: if the object.getClass() that I want to save is not 
registered, get the superClass of that object and save it as that 
SuperClass (below is some example code of what I have done so far):

Note: there are always transactions opened when I want to do this, this is 
the reason I don't register the class. 


       Class<? extends Object> aClass = object.getClass();
        
        if(!db.getEntityManager().getRegisteredEntities().contains(aClass)) 
{
            while (aClass != Object.class) {
                aClass = aClass.getSuperclass();
                if 
(db.getEntityManager().getRegisteredEntities().contains(aClass)){
                    database.save(aClass);
                    return;
                }
            }
        }
        database.save(object);

Sorry for my english :(

-- 

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