Project overview

Registered by Franck

How to use this project

Blueprint information

Status:
Complete
Approver:
Franck
Priority:
Essential
Drafter:
Franck
Direction:
Approved
Assignee:
Franck
Definition:
Approved
Series goal:
Accepted for trunk
Implementation:
Informational Informational
Milestone target:
None
Started by
Franck
Completed by
Franck

Related branches

Sprints

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.getSormTemplate().execute(yourCallback).

SormTemplate takes care of creating a session, beginning it, commiting (or not), catching exceptions and closing the session.
The callback (implementing SormCallback or SormCallbackNoflush), will do the real work within the session.

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 DataValidationException

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.