All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.crnk.jpa.internal.query.backend.criteria.JpaCriteriaQueryImpl Maven / Gradle / Ivy

package io.crnk.jpa.internal.query.backend.criteria;

import io.crnk.jpa.internal.query.AbstractJpaQueryImpl;
import io.crnk.jpa.internal.query.ComputedAttributeRegistryImpl;
import io.crnk.jpa.query.criteria.JpaCriteriaQuery;
import io.crnk.meta.provider.MetaPartition;

import javax.persistence.EntityManager;
import javax.persistence.criteria.CriteriaQuery;
import java.util.List;
import java.util.Map;

public class JpaCriteriaQueryImpl extends AbstractJpaQueryImpl>
		implements JpaCriteriaQuery {

	public JpaCriteriaQueryImpl(MetaPartition metaPartition, EntityManager em, Class clazz,
								ComputedAttributeRegistryImpl virtualAttrs) {
		super(metaPartition, em, clazz, virtualAttrs);
	}

	public JpaCriteriaQueryImpl(MetaPartition metaPartition, EntityManager em, Class clazz,
								ComputedAttributeRegistryImpl virtualAttrs, String attrName, List entityIds) {
		super(metaPartition, em, clazz, virtualAttrs, attrName, entityIds);
	}

	public CriteriaQuery buildQuery() {
		return buildExecutor().getQuery();
	}

	@Override
	public JpaCriteriaQueryExecutorImpl buildExecutor() {
		return (JpaCriteriaQueryExecutorImpl) super.buildExecutor();
	}

	@Override
	protected JpaCriteriaQueryBackend newBackend() {
		return new JpaCriteriaQueryBackend<>(this, em, clazz, parentMeta, parentAttr, parentIdSelection);
	}

	@Override
	protected JpaCriteriaQueryExecutorImpl newExecutor(JpaCriteriaQueryBackend ctx, int numAutoSelections, Map selectionBindings) {
		return new JpaCriteriaQueryExecutorImpl<>(em, meta, ctx.getCriteriaQuery(), numAutoSelections, selectionBindings);
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy