db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Fischer <tfisc...@apache.org>
Subject RE: Question regarding Criterias
Date Tue, 01 Nov 2005 11:31:27 GMT


On Tue, 18 Oct 2005, Asaf Shakarchi wrote:

> Hey,
> Damn, why it's soooo complex to do such an easy task? :)
>
> Why Criterion class doesn't have adjoin func? Then it would be possible 
> to create two Criterions and use 'or' function between them,

Patches are appreciated :-)

>
> Well, here's my code anyway:
>
>
>
> Criteria crit = new Criteria();
>
> Criteria.Criterion linkFieldConnectorToField1 =
> crit.getNewCriterion(FieldConnectorPeer.FIELD_ID1,FieldPeer.FIELD_ID,
> Criteria.EQUAL);
>
> Criteria.Criterion linkFieldConnectorToField2=
> crit.getNewCriterion(FieldConnectorPeer.FIELD_ID2,FieldPeer.FIELD_ID,
> Criteria.EQUAL);
>
> Criteria.Criterion linkBothFieldConnectorToField =
> linkFieldConnectorToField1.or(linkFieldConnectorToField2);
>
> crit.add(linkBothFieldConnectorToField);
>
>
> Well, this result a fine query but compare the fields to strings, I don't
> understand, if the type of the field in the Criterions is PEER's field, why
> the generated query doesn't set a condition of a field and assume it's a
> text?

Sorry, I did not understand what the problem is. Can you please try to 
explain again ?

>
> Thanks a lot
> Asaf.
>

    Thomas

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


Mime
View raw message