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

io.katharsis.jpa.query.querydsl.QuerydslQueryFactory Maven / Gradle / Ivy

There is a newer version: 3.0.2
Show newest version
package io.katharsis.jpa.query.querydsl;

import java.lang.reflect.Type;
import java.util.List;

import io.katharsis.jpa.internal.JpaQueryFactoryBase;
import io.katharsis.jpa.internal.query.backend.querydsl.QuerydslQueryImpl;
import io.katharsis.jpa.query.JpaQueryFactory;

public class QuerydslQueryFactory extends JpaQueryFactoryBase implements JpaQueryFactory {

	private QuerydslQueryFactory() {
	}

	public static QuerydslQueryFactory newInstance() {
		return new QuerydslQueryFactory();
	}

	@Override
	public  QuerydslQuery query(Class entityClass) {
		return new QuerydslQueryImpl<>(metaLookup, em, entityClass, computedAttrs);
	}

	@SuppressWarnings({ "rawtypes", "unchecked" })
	@Override
	public  QuerydslQuery query(Class entityClass, String attrName, List entityIds) {
		return new QuerydslQueryImpl(metaLookup, em, entityClass, computedAttrs, attrName, entityIds);
	}

	public void registerComputedAttribute(Class targetClass, String attributeName, Type attributeType,
			QuerydslExpressionFactory expressionFactory) {
		computedAttrs.register(targetClass, attributeName, expressionFactory, attributeType);
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy