On 05.05.10 23:28, wzhao6...@gmail.com wrote: > Hi there, > > I need to strip off all the selected columns (getSelectedColumns(), and > getAsColumns()) from a criteria object, is there a way for me to do that? > For examples: > Criteria criteria = new Criteria(); > criteria.addJoin(PermissionPeer.PERMISSION_ID,RolePermissionPeer.PERMISSION_ID); > criteria.addJoin(RolePermissionPeer.ROLE_ID, RolePeer.ROLE_ID); > criteria.add(PermissionPeer.PERMISSION_ID, 1, Criteria.EQUAL) > criteria.addSelectColumn(PermissionPeer.PERMISSION_ID); > criteria.addAsColumn("permission", PermissionPeer.PERMISSION_ID); > criteria.setDistinct(); > > where, I'd like to remove the selected columns: > PermissionPeer.PERMISSION_ID,, but > criteria.remove(PermissionPeer.PERMISSION_ID); > doesn't do it for me.
Several databases require all columns used in the where-clause to be in the list of selected columns, too. Furthermore, the Peer classes expect all columns needed for the construction of the OM object to be present in the result set. If you use BasePeer.doSelect, however, you can build any criteria you want. You will get back Village records, though. Bye, Thomas. --------------------------------------------------------------------- To unsubscribe, e-mail: torque-user-unsubscr...@db.apache.org For additional commands, e-mail: torque-user-h...@db.apache.org