It works like this : Criteria criteria = new Criteria(); Criteria.Criterion crit1 = criteria.getNewCriterion(table.id,(Object)null,Criteria.ISNOTNULL); Criteria.Criterion crit2 = criteria.getNewCriterion(table1.date1,new Date() ,Criteria.LESS_THAN); Criteria.Criterion crit3 = criteria.getNewCriterion(table2.date2,new Date(),Criteria.GREATER_THAN);
criteria.add(crit1.or(crit2.and(crit3))); > Are you sure? Have you seen Criteria.Criterion?? > (http://db.apache.org/torque/criteria-howto.html) yes!! Criterion is only useful for different Criteria for the same column for instance, you can do: table.date<today or table.date is null but not interesting things like: table.id is not null or (table1.date1 < today and table2.date2 > today) see the implementation! > I don't think torque is limited to single column primary key, you > can > define more columns as primary keys but you need to specify > idMethod none > since only you know how to generate these primay key values (most > probably they are foreign keys to another table) ok, sorry, you are right i was not clear enough, i wanted say that Criteria does not take advantage of the meta info of a table when a more columns pk is used, as i wrote later: >- when you support more general pks, it should be nice when > Criteria allows to specify a join (over several fields), and other > things, just given a PrimaryKey object (which should refer to > several columns, of course) cheers Michael --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
