Clayton
unread,Nov 6, 2009, 12:06:51 AM11/6/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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