
org.jinq.jpa.transform.DistinctTransform 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 org.jinq.jpa.jpqlquery.JPQLQuery;
import org.jinq.jpa.jpqlquery.SelectOnly;
public class DistinctTransform extends JPQLNoLambdaQueryTransform
{
public DistinctTransform(JPQLQueryTransformConfiguration config)
{
super(config);
}
public JPQLQuery apply(JPQLQuery query, SymbExArgumentHandler parentArgumentScope) throws QueryTransformException
{
if (query.canDistinct())
{
SelectOnly select = (SelectOnly)query;
// Create the new query, merging in the analysis of the method
SelectOnly toReturn = (SelectOnly)select.shallowCopy();
toReturn.isDistinct = true;
return toReturn;
}
throw new QueryTransformException("Existing query cannot be transformed further");
}
@Override
public String getTransformationTypeCachingTag()
{
return DistinctTransform.class.getName();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy