I'm new to Hibernate and trying to understand how, at a high level, Hibernate works in a large IOC container environment. Here is the general scenario:
- A controller object invokes a domain object method, passing the parameters required to perform an update in a DTO
- The IOC container starts a transaction (presumably, and a Hibernate session)
- The domain object method requests the container to instantiate the top-level business object(s)
- The domain object method invokes setters and business methods that perform the update within the business objects
- The domain object method commits the transaction
Assume the business objects are properly annotated and the IOC container and Hibernate are fully configured. Here are my questions:
- If the IOC container "load(entity, id)" method is invoked, will it cooperate with Hibernate to instantiate the entity without some form of DAO helper class?
- Will Hibernate instrument entity classes to load contained entities when the parent getters are invoked?
- Will Hibernate keep track of the entities loaded during the session and persist the dirty entities when the session is flushed?
Thanks in advance for your thoughts...