com.emc.documentum.springdata.repository.query.DctmQueryCreator Maven / Gradle / Ivy
The newest version!
package com.emc.documentum.springdata.repository.query;
import java.util.ArrayList;
import java.util.Iterator;
import org.springframework.data.domain.Sort;
import org.springframework.data.mapping.PropertyPath;
import org.springframework.data.repository.query.ParameterAccessor;
import org.springframework.data.repository.query.parser.AbstractQueryCreator;
import org.springframework.data.repository.query.parser.Part;
import org.springframework.data.repository.query.parser.PartTree;
import org.springframework.util.Assert;
import com.documentum.fc.common.DfException;
import com.emc.documentum.springdata.entitymanager.attributes.AttributeType;
import com.emc.documentum.springdata.entitymanager.mapping.MappingHandler;
import com.mysema.query.BooleanBuilder;
import com.mysema.query.types.ConstantImpl;
import com.mysema.query.types.Predicate;
import com.mysema.query.types.expr.BooleanOperation;
import com.mysema.query.types.path.PathBuilder;
/*
* Copyright (c) 2015 EMC Corporation. All Rights Reserved.
* EMC Confidential: Restricted Internal Distribution
*/
public class DctmQueryCreator extends AbstractQueryCreator {
private final PathBuilder pathBuilder;
private final MappingHandler mappingHandler;
private DctmQueryMethod queryMethod;
@SuppressWarnings("unchecked")
public DctmQueryCreator(MappingHandler mappingHandler, PartTree tree, DctmQueryMethod queryMethod, ParameterAccessor accessor) {
super(tree, accessor);
this.mappingHandler = mappingHandler;
this.queryMethod = queryMethod;
pathBuilder = new PathBuilder(queryMethod.getEntityInformation().getJavaType(), queryMethod.getEntityInformation().getDctmEntityName());
}
@SuppressWarnings("unchecked")
@Override
protected Predicate create(Part part, Iterator