Hibernate ORM helper changes in M6 (some requiring code changes)

Just to point out after an upgrade to M6 plus some debugging, there
are some changes new in Hibernate ORM helpers in M6 that might warrant
mention. Figured I'd post to list just to alleviate pain for others
in the same situation.

* findWhere() and findAllWhere() method parameters have changed,
requiring a tweak in your code to account for the change. Instead of
accepting any add'l arguments besides orm entityName as the criteria,
both functions now expect a "criteria" structure.

Before I called findWhere( name=rc.name ); on a VirtualEntityService
object. Worked under M5 but in M6 would silently fail without even
calling db (nothing in Hibernate sql log). This is now changed to
findWhere( criteria = { name = rc.name } ); to use the new struct
parameter convention.

Luis - please note this change in wiki as it is incorrect there:
http://wiki.coldbox.org/wiki/Extras:BaseORMService.cfm#findWhere

Other changes, while I'm looking at SVN diff, as far as method/
parameter changes that may affect existing code...
* looks like new() parameters did a similar change as findWhere(), but
it appears to be backwards compatible. initial data can be passed in
as a "properties" struct argument instead of directly as arguments.
if "properties" argument doesn't exist, it populates from arguments as
before (backwards compat).
* find() is now findIt()
* get() now returns a new() entity if passed id=0.
* deleteByID() returns # of rows deleted instead of boolean
* new deleteAll() function
* new validate(entity) function calls underlying Hibernate Validator()
* new inline populate() functions so you don't have to instantiate a
BeanFactory plugin to do so. includes al populateFrom*() commands from
BeanFactory.
* ties into event handling system to trigger ORM event handler /
interceptors

-m

Thanks, find documentation updated.

Luis F. Majano
President
Ortus Solutions, Corp

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

http://blog.coldbox.org/post.cfm/coldbox-orm-service-changes-from-m5-to-m6

Luis F. Majano
President
Ortus Solutions, Corp

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Glad to help.