Hi Eric,
On Saturday, December 26, 2015 at 11:20:33 PM UTC+1, Erik Pragt wrote:
>
>
>> I haven't used Object database, but I would expect it needs a
>> proxy-entity, so you would probably need to fetch - update,
>> see
>> http://orientdb.com/docs/2.0/orientdb.wiki/Object-2-Record-Java-Binding.html
>> "
>> You can save a POJO to the database by calling the method save(pojo). If
>> the POJO is already a proxied instance, then the database will just save
>> the record bounded to it. In case the object is not proxied the database
>> will serialize it and save the corresponded record: *In this case the
>> object MUST be reassinged with the one returned by the database*
>> "
>>
>>
> Hi /m,
>
> Thanks for the reply, but I've read the above 3 times now, and I still
> don't know what it means. I have no proxied object, just a normal POJO, so
> this should apply:
>
> "In case the object is not proxied the database will serialize it and save
> the corresponded record: *In this case the object MUST be reassinged with
> the one returned by the database"*
> "In case the object is not proxied the database serialize it and save the
> corresponded record"...okay, I think I know what that means, cause that's
> what I'm trying, and then:
> *"In this case the object MUST be reassinged with the one returned by the
> database"*....ehh...wot? In this case the object must be what?
> Reassinged? Reassigned? I unfortunately have no idea what it means.
>
> I think I have a simple use case:
> I want to create new Book, save it (create a new one in the db), change
> eg. the title, and save it again (ie updating the values). But the above
> text helps little in accomplishing that. I'll have a look at the fetching
> though (would that be the same as loading? (public <RET> RET load(final
> Object
> iPojo)
>
> I have no idea what an iPojo is. Is says it's "the entity to load". But
> that's not really clear, especially when the code examples show only
> examples with rids: Animal animal = database.load(rid); (see
> http://orientdb.com/docs/2.0/orientdb.wiki/Object-Database.html). So, an
> iPojo is an rid??? I'm confused :)
>
> Cheers, Erik
>
>
it is pretty simple:
you can create an object yourself (e.g. new Object()). That object is in
your control, none proxy one. Object you retrieve through orient entity
manager, is proxy one, backed by entity manager.
In second case any value you change and you call save, changes will be
done on existing object: simply because object has an id (RID)...
I don't know about "reassigned" description, but I guess, they mean
*values* need to be reassigned (copied over?) it is confusing.
In any case, what you should try is to: save an object e.g.
MyObject save(MyObject o){
}
>
>
>
>
>
>
>> hth,
>> cheers
>> /m
>>
>>
>>>
>>> Thanks,
>>>
>>>
>>> Erik
>>>
>>>
>>>
--
---
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.