db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Fox <Thomas....@seitenbau.net>
Subject Re: Criterions which do not reference a column
Date Wed, 04 Apr 2012 16:22:17 GMT
Thomas Vandahl wrote:

> 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)
> > to
> >    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?

I do not understand what you want to achieve with this. One can certainly
generify the Criterion object, but at the end of the day the Criterion gets
plugged into the and(Criterion), or(Criterion), ...  methods in the
Criteria (which would be changed to and(Criterion<?, ?>), which does not
add any compiletime safety.
But perhaps I do not understand your suggestion completely...

> ...


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


Mime
View raw message