Hey everybody, we just committed support for Dynamic Finders and Counters for all ORM services: Base, Virtual and ActiveEntity.
Check out the docs:
http://wiki.coldbox.org/wiki/WhatsNew:3.5.3.cfm
Let’s say you have the following entity:
component persistent="true" name="User" extends="coldbox.system.orm.hibernate.ActiveEntity"{
property name="id" column="user_id" fieldType="id" generator="uuid";
property name="lastName";
property name="userName";
property name="password";
property name="lastLogin" ormtype="date";
}
Then we could do the following:
user = entityNew("User").findByLastName("Majano");
users = entityNew("User").findAllByLastNameLike("Ma%");
users = entityNew("User").findAllByLastLoginBetween( "01/01/2010", "01/01/2012" );
users = entityNew("User").findAllByLastLoginGreaterThan( "01/01/2010" );
users = entityNew("User").findAllByLastLoginGreaterThanAndLastNameLike( "01/01/2010", "jo%");
count = entityNew("User").countByLastLoginGreaterThan( "01/01/2010" );
count = entityNew("User").countByLastLoginGreaterThanAndLastNameLike( "01/01/2010", "jo%");
Luis F. Majano
CEO
Ortus Solutions, Corp
www.ortussolutions.com
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