I implemented this pattern and got a different behavior. When entering
in the onFlushDirty event, I receive the 'entity' object filled with
AuditInfo data, and when entering onSave event, in the line:
AuditInfo ai = ((Auditable) entity).getAuditInfo();
the outcome of getAuditInfo is null, failing in the next ai.setCreated
line.
I think I left something to configure or define since Hibernate
refused to process the mytable.hbm.xml due to the lack of setAuditInfo
member (the interface correctly defined only the getter), so I must
put the setter in the definition to get Hibernate happy (this may be
the root cause of my issue)...
What am I missing to do?
Thank you very much,
Leandro. |