package com.jorgediaz.indexchecker.model;

import com.liferay.portal.kernel.dao.orm.Conjunction;
import com.liferay.portal.kernel.dao.orm.Criterion;
import com.liferay.portal.kernel.dao.orm.DynamicQuery;
import com.liferay.portal.kernel.dao.orm.RestrictionsFactoryUtil;
import com.liferay.portal.kernel.workflow.WorkflowConstants;
import com.liferay.portal.model.User;
public class Contact extends IndexCheckerModel {

	@Override
	public Criterion generateQueryFilter() {

		Conjunction conjunction = RestrictionsFactoryUtil.conjunction();

		DynamicQuery userDynamicQuery = this.newDynamicQuery(User.class);

		userDynamicQuery.setProjection(getPropertyProjection("userId"));

		userDynamicQuery.add(RestrictionsFactoryUtil.disjunction().add(
			getProperty("defaultUser").eq(true)).add(
				getProperty("status").ne(WorkflowConstants.STATUS_APPROVED)));

		conjunction.add(getProperty("classPK").notIn(userDynamicQuery));

		return conjunction;
	}

}
@@ -698,125 +698,64 @@
 add(
-RestrictionsFactoryUtil.disjunction().add(%0A%09%09%09getProperty(%22defaultUser%22).eq(true)).add(%0A%09%09%09%09getProperty(%22status%22).ne(
+generateCriterionFilter(%0A%09%09%09%22defaultUser=true+status%3C%3E%22+
 Work
@@ -785,17 +785,16 @@
 PROVED))
-)
 ;%0A%0A%09%09con

Use generateCriterionFilter method