Property<?> attributeIdentityProp = modelProperties.get(PROPERTY_ATTRIBUTE_IDENTITY);
Property<?> attributeNameProp = modelProperties.get(PROPERTY_ATTRIBUTE_NAME);
Property<?> attributeValueProp = modelProperties.get(PROPERTY_ATTRIBUTE_VALUE);
CriteriaBuilder builder = em.getCriteriaBuilder();
CriteriaQuery<?> criteria = builder.createQuery(attributeClass);
Root<?> root = criteria.from(attributeClass);
List<Predicate> predicates = new ArrayList<Predicate>();
predicates.add(builder.equal(root.get(attributeIdentityProp.getName()),
lookupIdentity(identity, em)));