U can use following command..................
Whatever column's value  u want to get u have to mention that's column name
.

crit.addGroupByColumn(TurbineUserPeer.USER_LANG);

2010/5/6 wzhao6...@gmail.com <wzhao6...@gmail.com>

> 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.
>
> I understand that criteria is essentially a HashTable, but only WHERE
> clause
> (through criteria.add(...) ) has a key in criteria, I can't find join and
> column
> key information from the criteria.keySet()?
>
> BTW, how do I re-construct a criteria by putting all the pieces in criteria
> together? I don't want to use criteria.clone() in this case.
> Thanks in advance!
>
> David
>

Reply via email to