Skip to content

Commit

Permalink
HHH-5816 Expose list of modified properties in PostUpdateEvent
Browse files Browse the repository at this point in the history
  • Loading branch information
emmanuelbernard committed Jan 4, 2011
1 parent 1394d52 commit dad565b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,8 @@ private void postUpdate() {
getInstance(),
getId(),
state,
previousState,
previousState,
dirtyFields,
getPersister(),
(EventSource) getSession()
);
Expand All @@ -208,7 +209,8 @@ private void postCommitUpdate() {
getInstance(),
getId(),
state,
previousState,
previousState,
dirtyFields,
getPersister(),
(EventSource) getSession()
);
Expand Down
8 changes: 8 additions & 0 deletions core/src/main/java/org/hibernate/event/PostUpdateEvent.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,15 @@ public class PostUpdateEvent extends AbstractEvent {
private Object[] state;
private Object[] oldState;
private Serializable id;
//list of dirty properties as computed by Hibernate during a FlushEntityEvent
private final int[] dirtyProperties;

public PostUpdateEvent(
Object entity,
Serializable id,
Object[] state,
Object[] oldState,
int[] dirtyProperties,
EntityPersister persister,
EventSource source
) {
Expand All @@ -53,6 +56,7 @@ public PostUpdateEvent(
this.id = id;
this.state = state;
this.oldState = oldState;
this.dirtyProperties = dirtyProperties;
this.persister = persister;
}

Expand All @@ -71,4 +75,8 @@ public EntityPersister getPersister() {
public Object[] getState() {
return state;
}

public int[] getDirtyProperties() {
return dirtyProperties;
}
}

0 comments on commit dad565b

Please sign in to comment.