
org.jinq.jpa.transform.JPQLQueryTransformConfiguration Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jinq-jpa-impl Show documentation
Show all versions of jinq-jpa-impl Show documentation
Implementation classes for Jinq functional-style queries for JPA
The newest version!
package org.jinq.jpa.transform;
import java.util.List;
import java.util.Map;
import ch.epfl.labos.iu.orm.queryll2.path.PathAnalysis;
import ch.epfl.labos.iu.orm.queryll2.symbolic.MethodSignature;
import ch.epfl.labos.iu.orm.queryll2.symbolic.TypedValue;
public class JPQLQueryTransformConfiguration
{
public MetamodelUtil metamodel;
/**
* When dealing with subqueries, we may need to inspect the code of
* lambdas used in the subquery. This may require us to use a special
* class loader to extract that code.
*/
public ClassLoader alternateClassLoader;
public boolean isObjectEqualsSafe;
public boolean isAllEqualsSafe;
public boolean isCollectionContainsSafe;
public Map
getComparisonMethods()
{
return metamodel.getComparisonMethods(isObjectEqualsSafe);
}
public Map
getComparisonStaticMethods()
{
return metamodel.getComparisonStaticMethods(isObjectEqualsSafe);
}
public SymbExToColumns newSymbExToColumns(SymbExArgumentHandler argumentHandler)
{
return new SymbExToColumns(this, argumentHandler);
}
public SymbExToSubQuery newSymbExToSubQuery(SymbExArgumentHandler argumentHandler, boolean isExpectingStream)
{
return new SymbExToSubQuery(this, argumentHandler, isExpectingStream);
}
public Map findLambdaAsClassConstructorParameters(MethodSignature sig, List args) throws QueryTransformException
{
throw new IllegalArgumentException("Using classes as lambdas is not supported in Java Jinq");
}
public void checkLambdaSideEffects(LambdaAnalysis lambda) throws QueryTransformException
{
for (PathAnalysis path: lambda.symbolicAnalysis.paths)
{
if (!path.getSideEffects().isEmpty())
throw new QueryTransformException("Lambda has a side-effect that can't be emulated with a database query");
}
}
public JPQLQueryTransformConfiguration()
{
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy