The problem is my DAO support is coupled to my domain objects. When hibernate loads the entity it does not insert the supporting datamapper and validator. The datamapper/DAO is used when I call entity.insert().
Not sure I explained that well :shock:
The problem is my DAO support is coupled to my domain objects. When hibernate loads the entity it does not insert the supporting datamapper and validator. The datamapper/DAO is used when I call entity.insert().
Not sure I explained that well :shock:
In truth, I am not all that familiar with the Hibernate class that you are using.
Still, if you are sure it is working correctly and double checked everything, then "if it works, it works"
But I am still not clear why you are
instead ofCode:DomainObject entity = (DomainObject) event.getSession().getPersistenceContext().getEntity( new EntityKey( event.getId(), event.getPersister(), EntityMode.POJO) );
Maybe I am missing somethingCode:DomainObject entity = (DomainObject) event.getEntity();![]()
I came up with this AOP-based alternative approach which I think is more performant and not dependent on any hibernate features:Originally Posted by benholland
http://www.digizenstudio.com/blog/20...omain-objects/
--Jing Xue
Thanks for the suggestion and it got me thinking. Unfortunately I cant use AOP on this project but shall use the info for a work around. Shall post anything I come up with.
Thanks,
Ben