Hi,
I have following DetachedQuery:
Code:
DetachedCriteria criteria = DetachedCriteria.forClass(Project.class, "project");
criteria.createAlias("status","projectStatus", CriteriaSpecification.LEFT_JOIN);
criteria.createAlias("priority","projectPriority", CriteriaSpecification.LEFT_JOIN);
criteria.createAlias("type","projectType", CriteriaSpecification.LEFT_JOIN);
criteria.createAlias("account","projectAccount", CriteriaSpecification.LEFT_JOIN);
criteria.createAlias("owner","projectOwner", CriteriaSpecification.LEFT_JOIN);
criteria.setProjection(
Projections.projectionList()
.add(Projections.alias(Projections.property("uuid"), "uuid"))
.add(Projections.alias(Projections.property("name"), "name"))
.add(Projections.alias(Projections.property("rKey"), "rKey"))
.add(Projections.alias(Projections.property("description"), "description"))
.add(Projections.alias(Projections.property("expectedStartDate"), "expectedStartDate"))
.add(Projections.alias(Projections.property("expectedEndDate"), "expectedEndDate"))
.add(Projections.alias(Projections.property("projectStatus.status"), "status"))
.add(Projections.alias(Projections.property("projectStatus.color"), "rowcolor"))
.add(Projections.alias(Projections.property("projectOwner.name"), "ownerName"))
.add(Projections.alias(Projections.property("projectOwner.surname"), "ownerSurname"))
.add(Projections.alias(Projections.property("projectPriority.priority"), "priority"))
.add(Projections.alias(Projections.property("projectType.type"), "type"))
.add(Projections.alias(Projections.property("projectAccount.shortTitle"), "account"))
);
criteria.setResultTransformer(Transformers.aliasToBean(ProjectView.class));
if I add
Code:
criteria.add(Restrictions.ilike("status","%Active%"));
I get:
Code:
could not get a field value by reflection getter of com.objectverse.projects.project.model.sets.ProjectStatus.uuid; nested exception is org.hibernate.PropertyAccessException: could not get a field value by reflection getter of com.objectverse.projects.project.model.sets.ProjectStatus.uuid
What is the correct way to filter collection. How can I avoid this exception?