i want manage dao in same way:
1) create 1 base class entity operations save, update, delete, etc.
2) each dao inherits base class , performs base class operations.
3) entities have 1 root.
public abstract basedao { ... @transactional public t update(t entity) throws dataaccessexception { gethibernatetemplate().update(entity); return entity; } } ... public memberdao extends basedao { ... @override @transactional public imember update(imember member) throws dataaccessexception { super.update(member); return member; } } and there 2 possible way:
1) based on hibernatedaosupport , gethibernatetemplate()
2) based on getentitymanagerfactory().createentitymanager()
main question approach based on hibernatetemplate or on entitymanager - of them better use?
underlying jpa provider in both cases hibernate.
Comments
Post a Comment