Project overview
How to use this project
Blueprint information
Whiteboard
This objective of mkorm is to facilitate the use of Simpleorm within the Springframework.
Essentially, mkorm implements the Template strategy, so that the standard session machenery is automated and the developper can concentrate on the real work that must be done. It will also avoid a lot of copy and paste code.
The principle is that you Data Access Object will extends SormDaoSupport.
Then you wil be able to do :
dao.getSormTemp
SormTemplate takes care of creating a session, beginning it, commiting (or not), catching exceptions and closing the session.
The callback (implementing SormCallback or SormCallbackNof
Benefit of using SormTemplate include :
- the connections used will participate in Spring transaction management if configured so
- the algorithm will handle corner cases to make sure transactions are commited or rollbacked if necessary, sessions are closed, etc. And no need to copy and paste to do so.
- exceptions are translated into Spring runtime DataAccessException hierarchy, or into mkorm own DataValidationE