Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No CollectionEvent on entity update #12

Open
rico opened this issue Apr 13, 2011 · 1 comment
Open

No CollectionEvent on entity update #12

rico opened this issue Apr 13, 2011 · 1 comment

Comments

@rico
Copy link

rico commented Apr 13, 2011

It seems that no CollectionEvent of type "update" is dispatched when a entity property is updated:

repository.entities.addEventListener(CollectionEvent.COLLECTION_CHANGE, collectionChangeHandler )

private function collectionChangeHandler(e:CollectionEvent):void
{

   trace("change => " + e.kind);

}

When adding/persisting an entity:

[INFO] org.davekeen.flextrine.orm.EntityRepository Adding [NestCheckEntity id=null] {repository=NestCheckEntity, tempUid=49FE954D-61CA-1D9B-DABC-4F40A1A67FD0}
change => add

[INFO] org.davekeen.flextrine.orm.EntityManager Persisting [NestCheckEntity id=null]

change => refresh

Updating a property:

[INFO] org.davekeen.flextrine.orm.EntityRepository Detected change on managed entity [NestCheckEntity id=null] - property 'checkdate' from 'Tue Apr 5 00:00:00 GMT+0200 2011' to 'Mon Apr 11 00:00:00 GMT+0200 2011' {repository = NestCheckEntity}

@rico
Copy link
Author

rico commented Apr 16, 2011

I've found a simple workaround for this by just refreshing the entities when a property gets updated:

EntityRepository.as Line 595
log.info("Detected change on managed entity " + e.currentTarget + " - property '" + e.property + "' from '" + e.oldValue + "' to '" + e.newValue + "' {repository = " + ClassUtil.formatClassAsString(entityClass) + "}");
EntityRepository.as Line 596 (inserted)
entities.refresh();

Not very nice, but it works - rico

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant