[Prev] Thread [Next]  |  [Prev] Date [Next]

Re: Criterions which do not reference a column Thomas Vandahl Tue Apr 03 12:01:56 2012

Am 03.04.2012 05:29, schrieb Thomas Fox:
I have the following ideas to implement this:

1)  Change the criteria.Criteria interface from
   and(String column, Object value)
   and(Column column, Object value)
   and(String column, Object value, SqlEnum comparison)
   and(Column column, Object value, SqlEnum comparison)
   and (Object lhs, Object rhs)
   and (Object lhs, Object rhs, SqlEnum comparison)

I like this idea for it is simple and intuitive. What I don't like are methods that take objects because they have no compile-time type checking. My suggestion would be to consider generics like so:

public <L, R> and(L lhs, R rhs)

I didn't think this through completely but do you think this could work?

P.S. to care for other such cases which are not covered by the above, I
intend to add the methods
   andCustom(String query, Object[] preparedStatementReplacements)
   orCustom(String query, Object[] preparedStatementReplacements)
so one can also create custom criterions which use prepared statement
replacement. Any objections on this ?

Looks reasonable to me, go ahead.

Bye, Thomas.

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]