com.github.aqiu202.starters.jpa.query.dsl.JPAProjections Maven / Gradle / Ivy
package com.github.aqiu202.starters.jpa.query.dsl;
import com.google.common.collect.ImmutableList;
import com.querydsl.core.types.Expression;
import com.querydsl.core.types.Path;
import java.util.Map;
/**
* workplan
*
* @author aqiu 2020/10/25 22:21
**/
public final class JPAProjections {
public static JPAQBeans bean(Class extends T> type, Expression>... exprs) {
return new JPAQBeans<>(type, exprs);
}
public static JPAQBeans bean(Path extends T> path, Expression>... exprs) {
return new JPAQBeans<>(path.getType(), exprs);
}
public static JPAQBeans fields(Class extends T> type, Expression>... exprs) {
return new JPAQBeans(type, true, exprs);
}
public static JPAQBeans fields(Path extends T> type, Expression>... exprs) {
return new JPAQBeans(type.getType(), true, exprs);
}
public static JPAQBeans fields(Path extends T> type,
Map> bindings) {
return new JPAQBeans(type.getType(), true, bindings);
}
public static JPAQBeans fields(Class extends T> type,
Map> bindings) {
return new JPAQBeans(type, true, bindings);
}
public static JPAQMaps map(Expression>... exprs) {
return new JPAQMaps(exprs);
}
public static JPAQTuple tuple(Expression>... exprs) {
return new JPAQTuple(exprs);
}
public static JPAQTuple tuple(ImmutableList> exprs) {
return new JPAQTuple(exprs);
}
public static JPAQTuple tuple(Expression>[]... exprs) {
return new JPAQTuple(exprs);
}
}