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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to