Steve Ebersole edited a comment on Technical task HHH-8354

not quite sure what the findDirty method should do

First, that specific block you are talking about is the default CustomEntityDirtinessStrategy strategy to use if the application has not supplied one. CustomEntityDirtinessStrategy is a different parallel approach to dirty tracking. This bytecode enhanced dirty tracking does not hook in there. At all. It should hook in the same place that the CustomEntityDirtinessStrategy check (and all other dirtiness checking) happens: org.hibernate.event.internal.DefaultFlushEntityEventListener#dirtyCheck

Ultimately here Hibernate needs to know the attributes that were dirty in terms of an int[]. The ints refer to the (internally based) attribute positions. The approach CustomEntityDirtinessStrategy takes is to iterate the attributes and for each one to ask the CustomEntityDirtinessStrategy (via the org.hibernate.CustomEntityDirtinessStrategy.DirtyCheckContext#doDirtyChecking and org.hibernate.CustomEntityDirtinessStrategy.AttributeChecker#isDirty communication. You took a different approach and just simply hand the attribute names back to Hibernate. There is nothing wrong with that per-se. CustomEntityDirtinessStrategy is from the start intended as a end-user hook-in point, and as such I wanted to make the API and clear and directed as possible. The main focus of DirtyTracker from the get-go is actually not end-user focused, so we don't necessarily have the same design goals in mind for both. 0

However within your choice you have to realize that you are bound by certain assumptions. As an example, consider a Person entity with an Address component. Imagine we enhance this entity. Then imagine the application calls: person.getAddress().setCity( "Austin" ). You see that there is nothing here to mark Person dirty right? The setter is called on the composite, not the entity.

This gets into what I talked about above. I think ultimately we want to start enhancing composites as well and have them mark their "owner" as dirty when they change. This is tricky though because a composite could be used in multiple attributes across multiple entities/collections.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira