You can select and group columns to be used in a query (select/list) search by adding a parameter QueryGroup in the entity definition. Each QueryGroup contains the columns to be used for a query. Each QueryGroup is identified by a unique name under which, the columns must be specified.
A global map QueryGroupMap is provided in the Entity class, which contains a unique query group name and attributes corresponding to the columns of the query group. This map is populated when entity repository is loaded.
Each entity can have multiple such query groups, which are defined under a parameter QueryGroups:
<Entity>
<QueryGroups>
<QueryGroup Name="PasswordQueryGroup">
<Column Name="PASSWORD"/>
<Column Name="IS_PASSWORD_ENCRYPTED"/>
<Column Name="SALT"/>
</QueryGroup>
<QueryGroup Name="BusinessQueryGroup">
<Column Name="BUSINESS_KEY"/>
<Column Name="CONTACTADDRESS_KEY"/>
<ColumnName="BILLINGADDRESS_KEY"/>
</QueryGroup>
</QueryGroups>
</Entity>
Any number of columns can be specified under the query group. However, columns must not be repeated for a query group.
public Set getColumnSetForQueryGroup(String queryGroupName)
public YFS_User selectWithWhereForQueryGroup(YFCDBContext ctx,
String aWhereClause, String queryGroupName) throws YFCDBException{
Set columns = getColumnSet(queryGroupName);
return selectWithWhere(ctx, aWhereClause, columns);
}