Couple thoughts on BaseORMService

Brett, I found something interesting in the hibernate docs:
Pg 416 of hibernate pdf explains how batch processing works in
hibernate – it’s automatic! How cool!

Flushing the persistence context
The Hibernate Session implements write-behind. Changes to persistent
objects
made in the scope of a persistence context aren’t immediately
propagated to the
database. This allows Hibernate to coalesce many changes into a
minimal number
of database requests, helping minimize the impact of network latency.
Another
excellent side-effect of executing DML as late as possible, toward the
end of the
transaction, is shorter lock durations inside the database.

For example, if a single property of an object is changed twice in the
same
persistence context, Hibernate needs to execute only one SQL UPDATE.
Another
example of the usefulness of write-behind is that Hibernate is able to
take
advantage of the JDBC batch API when executing multiple UPDATE,
INSERT, or
DELETE statements.

Good point John, so it would be nice to have a nice interface adapter
for the results object, and then the validate() method on the service
basically calls the validation framework and passes the entity for
validation and returns the result object. Then it is up to the caller
to use it accordingly. I like it.

Ideas?

Yes - that sounds perfect :slight_smile: