ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Josh Joy <joshjd...@gmail.com>
Subject Configuration by Convention - query by example and method naming convention
Date Sun, 20 Sep 2009 05:47:47 GMT
Hi,

I see on the ibatis 3.0 whiteboard, there are several proposed
examples of conventions, such as the following

"If we want parameters for a "query by example", we can support
something like this:

List<Employee> findEmployeesLike(Employee employee);

Assuming only lastName is set, all other reference types are null, and
primitives are set to some invalid number like -1...we can generate
something like:

SELECT id, firstName, lastName FROM Employee WHERE lastName = 'Begin'

Or a better convention by naming could be:

List<Employee> findEmployeeByLastNameAndFirstName (String last, String first);

This will yeild:

SELECT id, firstName, lastName FROM Employee WHERE lastName = 'Begin'
AND firstName = 'Clinton'"


Is query by example and method naming conventions supported? I looked
through the user guide for 3.0 and was unable to find any references
to the above... I think it would making coding easier if the above was
supported...

Thanks,
Josh

---------------------------------------------------------------------
To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-java-help@ibatis.apache.org


Mime
View raw message