New Feature: Method Name ==> Column Map map

28 views
Skip to first unread message

Clayton

unread,
Nov 6, 2009, 12:06:51 AM11/6/09
to Persist

I continue tweaking Persist to add features that I need, my latest
being adding some simple code to the TableMapping class that allows
you to pass in a method name and retrieve the db column name which is
associated with that method. This is useful for building conditional
queries which aren't just conditional the table primary keys, but on
arbitrary columns.

Pseudo-code snippet:

Persist p = new Persist(...)

...

TableMapping tm = (TableMapping) p.getMapping( <Object>.class,
<tableName> );
String selectSQL = tm.getSelectWhereSql() + tm.getColumnNameForMethod
( <methodNameString> ) + " is null";
p.readList( CPSCrop.class, selectSQL );


Rad! It's kind of slow around here, but this project has been too
useful to let it die.

Clayton
Reply all
Reply to author
Forward
0 new messages