This is better imho:
fieldCustom(String field, String expression, String[] paramsNames)
RIFE registers parameters by name and keeps track of them internally.
I don't really see the benefit of adding the type array.
On 06 Aug 2006, at 07:43, Steven Grimm wrote:
Maybe something as simple as
fieldCustom(String field, String expression, Object[] params)
which has the added advantage of working as a Java 5 varargs
method. For cases where types are ambiguous, maybe something like
fieldCustom(String field, String expression, Object[] params, int
[] types)
where you can pass in JDBC type codes for the arguments.
Given that people would be able to use this for arbitrarily complex
expressions, I'm not sure it'd be worth trying to impose any more
structure than that at the API level. Or rather, even if there is
eventually a more structured interface available, having this low-
level one will be good in any event.
-Steve
Geert Bevin wrote:
Hmmm, no that is not possible. It's not difficult at all to
implement, just need to come up with a syntax for it. Look at
fieldParameter for the implementation.
public Update fieldParameter(String field, String alias)
{
if (null == field) throw new
IllegalArgumentException("field can't be null.");
if (0 == field.length()) throw new IllegalArgumentException
("field can't be empty.");
if (null == alias) throw new
IllegalArgumentException("alias can't be null.");
if (0 == alias.length()) throw new IllegalArgumentException
("alias can't be empty.");
clearGenerated();
addFieldParameter(alias);
return _field(field, "?");
}
Any ideas about the syntax you'd like?
_______________________________________________
Rife-users mailing list
[email protected]
http://lists.uwyn.com/mailman/listinfo/rife-users
--
Geert Bevin
Uwyn "Use what you need" - http://uwyn.com
RIFE Java application framework - http://rifers.org
Music and words - http://gbevin.com
_______________________________________________
Rife-users mailing list
[email protected]
http://lists.uwyn.com/mailman/listinfo/rife-users