Managing POJOs with Tide

17 views
Skip to first unread message

Filip Nikšić

unread,
Feb 7, 2012, 12:17:17 PM2/7/12
to gran...@googlegroups.com
Hi,

is it possible to use Tide data management to manage POJOs? If yes, which steps are necessary to make this possible? I suppose I would have to manually implement the IEntity interface and include the entityManager field, together with the merge function. Would I also be required to implement my own Externalizer?

If I am missing something obvious, written in the documentation, could anyone direct me?

Best regards,
Filip

wdrai

unread,
Mar 5, 2012, 11:11:22 AM3/5/12
to gran...@googlegroups.com
That's not really documented, but simply adding adding [Managed] on your AS3 beans should be enough, you don't need any special externalization or something.
Tide will use a generic internal merge implementation so you won't need to implement the merge method yourself, and use an external dictionary to keep track of the entityManager if there is no entityManager field.

Filip Nikšić

unread,
Mar 7, 2012, 6:01:52 AM3/7/12
to Granite Data Services Forum
I'm afraid it doesn't work the way you described it.

For one thing, the function isInitialized has to be implemented
manually. I've noticed you usually surround the invocations of this
function with a try-catch block, catching the ReferenceError in case
the function isn't implemented, but there is at least one place where
you don't do that, namely the function EntityManager.mergeEntity.
Maybe this is a bug and should be reported to JIRA?

Also, if I understand it correctly, the external dictionary of
entityManagers is only used if the Managed.entityManagerMode is set to
Managed.ENTITY_MANAGER_DICTIONARY. Otherwise, the function
Managed.getEntityManager invokes the meta::entityManager getter on an
entity. So, the field should definitely be there, unless one wants all
entities to be managed by external entity managers. Maybe the
functions Managed.getEntityManager and Managed.setEntityManager should
be changed to revert to the entityManager dictionary if the
entityManager field isn't in the entity?

Best regards,
Filip

wdrai

unread,
Mar 13, 2012, 6:37:47 AM3/13/12
to gran...@googlegroups.com

Can you post a JIRA for this.
Reply all
Reply to author
Forward
0 new messages