public Criteria createClauseOnPk(String repositoryName,RepositoryView view,
PrimaryKey primaryKey) {
PrimaryKeyMap pk = view.getBeanDescriptor().getPrimaryKeyMap();
ArrayList keys = (ArrayList) pk.getPrimaryKey();
Criteria criteria = new Criteria(repositoryName);
for (int i = 0; i < keys.size(); i++) {
Criteria internal = null;
if (i > 0)
internal = new Criteria(repositoryName);
ItemDescriptor item = (ItemDescriptor) keys.get(i);
Object value = primaryKey.getValueKey(item.getPropertyName());
String columnName = item.getPropertyName();
if (i == 0)
criteria.addSelectEqualTo(columnName, value);
else
internal.addSelectEqualTo(columnName, value);
if (i > 0)
criteria.addAndCriteria(internal);
}
return criteria;