db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shaista Shekh <shaista.sh...@gmail.com>
Subject Re: How to strip off selected columns from a criteria object
Date Thu, 06 May 2010 11:30:15 GMT
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 wzhao6898@gmail.com <wzhao6898@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
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message