When you supply a parameter object the properties are immediately
available... for instance, if you passed in a Message and not a
List<Message>... you could use #{propertyName} and it would resolve
from your Message object's getPropertyName() method. Or if you passed
in a HashMap, you could use #{key} and it would do a HashMap.get(key);
The original object is always stored in _parameter, so you can access
what was originally passed in. For instance, if you wanted to use
getClass() in your conditionals to compare the type that was passed in
from the function. Or, in this case, if you want to reference the
entire object instead of just a property of it.
In practice I do something a little different (so I don't depend on a
"reserved' param name), something like
class QueryOptions {
private int startRow;
private int maxRows;
private List<Message> msgs;
.... (getters and setters)
}
Then when you pass in a QueryOptions object, you can do things like
dynamically add a LIMIT ${startRow}, ${maxRows} to selects if startRow
and maxRow !=null... and you can reference your insert messages as
msgs instead of _parameter.
Joe