@java.lang.SuppressWarnings({"rawtypes", "unchecked"}) public class JpaQueryBuilder extends java.lang.Object
Builds JPA 1.0 String-based queries from the Query model
Modifiers | Name | Description |
---|---|---|
private static interface |
JpaQueryBuilder.QueryHandler |
Modifiers | Name | Description |
---|---|---|
private static java.lang.String |
AS_CLAUSE |
|
private static char |
CLOSE_BRACKET |
|
private static char |
COMMA |
|
static java.lang.String |
DELETE_CLAUSE |
|
private static java.lang.String |
DISTINCT_CLAUSE |
|
private static char |
DOT |
|
private static java.lang.String |
FROM_CLAUSE |
|
static java.lang.String |
LOGICAL_AND |
|
static java.lang.String |
LOGICAL_OR |
|
static java.lang.String |
NOT_CLAUSE |
|
private static char |
OPEN_BRACKET |
|
private static java.lang.String |
ORDER_BY_CLAUSE |
|
static java.lang.String |
PARAMETER_NAME_PREFIX |
|
private static java.lang.String |
PARAMETER_PREFIX |
|
private static char |
QUESTIONMARK |
|
private static java.lang.String |
SELECT_CLAUSE |
|
private static char |
SPACE |
|
static java.lang.String |
UPDATE_CLAUSE |
|
private static java.lang.String |
WHERE_CLAUSE |
|
private org.springframework.core.convert.ConversionService |
conversionService |
|
private Junction |
criteria |
|
private PersistentEntity |
entity |
|
private boolean |
hibernateCompatible |
|
private java.lang.String |
logicalName |
|
private java.util.List<Query.Order> |
orders |
|
private ProjectionList |
projectionList |
|
private static java.util.Map<java.lang.Class, QueryHandler> |
queryHandlers |
Constructor and description |
---|
JpaQueryBuilder
(QueryableCriteria criteria) |
JpaQueryBuilder
(PersistentEntity entity, java.util.List<Query.Criterion> criteria) |
JpaQueryBuilder
(PersistentEntity entity, java.util.List<Query.Criterion> criteria, ProjectionList projectionList) |
JpaQueryBuilder
(PersistentEntity entity, java.util.List<Query.Criterion> criteria, ProjectionList projectionList, java.util.List<Query.Order> orders) |
JpaQueryBuilder
(PersistentEntity entity, Junction criteria) |
JpaQueryBuilder
(PersistentEntity entity, Junction criteria, ProjectionList projectionList) |
JpaQueryBuilder
(PersistentEntity entity, Junction criteria, ProjectionList projectionList, java.util.List<Query.Order> orders) |
Type Params | Return Type | Name and description |
---|---|---|
|
public static int |
appendCriteriaForOperator(java.lang.StringBuilder q, java.lang.String logicalName, java.lang.String name, int position, java.lang.String operator, boolean hibernateCompatible) |
|
protected void |
appendOrder(java.lang.StringBuilder queryString, java.lang.String logicalName) |
|
private static void |
appendPropertyComparison(java.lang.StringBuilder q, java.lang.String logicalName, java.lang.String propertyName, java.lang.String otherProperty, java.lang.String operator) |
|
public JpaQueryInfo |
buildDelete() Builds a DELETE statement |
|
public JpaQueryInfo |
buildSelect() Builds SELECT statement |
|
private static void |
buildSelect(java.lang.StringBuilder queryString, java.util.List<Query.Projection> projectionList, java.lang.String logicalName, PersistentEntity entity) |
|
private void |
buildSelectClause(java.lang.StringBuilder queryString) |
|
protected static void |
buildSubQuery(java.lang.StringBuilder q, java.lang.StringBuilder whereClause, int position, java.util.List parameters, org.springframework.core.convert.ConversionService conversionService, boolean allowJoins, boolean hibernateCompatible, QueryableCriteria subquery) |
|
public JpaQueryInfo |
buildUpdate(java.util.Map<java.lang.String, java.lang.Object> propertiesToUpdate) Builds an UPDATE statement. |
|
private void |
buildUpdateStatement(java.lang.StringBuilder queryString, java.util.Map<java.lang.String, java.lang.Object> propertiesToUpdate, java.util.List parameters, boolean hibernateCompatible) |
|
private java.util.List |
buildWhereClause(PersistentEntity entity, Junction criteria, java.lang.StringBuilder q, java.lang.StringBuilder whereClause, java.lang.String logicalName, boolean allowJoins) |
|
private java.util.List |
buildWhereClause(PersistentEntity entity, Junction criteria, java.lang.StringBuilder q, java.lang.StringBuilder whereClause, java.lang.String logicalName, boolean allowJoins, java.util.List parameters) |
|
static int |
buildWhereClauseForCriterion(PersistentEntity entity, Junction criteria, java.lang.StringBuilder q, java.lang.StringBuilder whereClause, java.lang.String logicalName, java.util.List<Query.Criterion> criterionList, int position, java.util.List parameters, org.springframework.core.convert.ConversionService conversionService, boolean allowJoins, boolean hibernateCompatible) |
|
public int |
handle(PersistentEntity entity, Criterion criterion, java.lang.StringBuilder q, java.lang.StringBuilder whereClause, java.lang.String logicalName, int position, java.util.List parameters, org.springframework.core.convert.ConversionService conversionService, boolean allowJoins, boolean hibernateCompatible) |
|
public int |
handle(PersistentEntity entity, Criterion criterion, java.lang.StringBuilder q, java.lang.StringBuilder whereClause, java.lang.String logicalName, int position, java.util.List parameters, org.springframework.core.convert.ConversionService conversionService, boolean allowJoins, boolean hibernateCompatible) |
|
public int |
handle(PersistentEntity entity, Criterion criterion, java.lang.StringBuilder q, java.lang.StringBuilder whereClause, java.lang.String logicalName, int position, java.util.List parameters, org.springframework.core.convert.ConversionService conversionService, boolean allowJoins, boolean hibernateCompatible) |
|
public int |
handle(PersistentEntity entity, Criterion criterion, java.lang.StringBuilder q, java.lang.StringBuilder whereClause, java.lang.String logicalName, int position, java.util.List parameters, org.springframework.core.convert.ConversionService conversionService, boolean allowJoins, boolean hibernateCompatible) |
|
public int |
handle(PersistentEntity entity, Criterion criterion, java.lang.StringBuilder q, java.lang.StringBuilder whereClause, java.lang.String logicalName, int position, java.util.List parameters, org.springframework.core.convert.ConversionService conversionService, boolean allowJoins, boolean hibernateCompatible) |
|
public int |
handle(PersistentEntity entity, Criterion criterion, java.lang.StringBuilder q, java.lang.StringBuilder whereClause, java.lang.String logicalName, int position, java.util.List parameters, org.springframework.core.convert.ConversionService conversionService, boolean allowJoins, boolean hibernateCompatible) |
|
public int |
handle(PersistentEntity entity, Criterion criterion, java.lang.StringBuilder q, java.lang.StringBuilder whereClause, java.lang.String logicalName, int position, java.util.List parameters, org.springframework.core.convert.ConversionService conversionService, boolean allowJoins, boolean hibernateCompatible) |
|
public int |
handle(PersistentEntity entity, Criterion criterion, java.lang.StringBuilder q, java.lang.StringBuilder whereClause, java.lang.String logicalName, int position, java.util.List parameters, org.springframework.core.convert.ConversionService conversionService, boolean allowJoins, boolean hibernateCompatible) |
|
public int |
handle(PersistentEntity entity, Criterion criterion, java.lang.StringBuilder q, java.lang.StringBuilder whereClause, java.lang.String logicalName, int position, java.util.List parameters, org.springframework.core.convert.ConversionService conversionService, boolean allowJoins, boolean hibernateCompatible) |
|
public int |
handle(PersistentEntity entity, Criterion criterion, java.lang.StringBuilder q, java.lang.StringBuilder whereClause, java.lang.String logicalName, int position, java.util.List parameters, org.springframework.core.convert.ConversionService conversionService, boolean allowJoins, boolean hibernateCompatible) |
|
public int |
handle(PersistentEntity entity, Criterion criterion, java.lang.StringBuilder q, java.lang.StringBuilder whereClause, java.lang.String logicalName, int position, java.util.List parameters, org.springframework.core.convert.ConversionService conversionService, boolean allowJoins, boolean hibernateCompatible) |
|
public int |
handle(PersistentEntity entity, Criterion criterion, java.lang.StringBuilder q, java.lang.StringBuilder whereClause, java.lang.String logicalName, int position, java.util.List parameters, org.springframework.core.convert.ConversionService conversionService, boolean allowJoins, boolean hibernateCompatible) |
|
public int |
handle(PersistentEntity entity, Criterion criterion, java.lang.StringBuilder q, java.lang.StringBuilder whereClause, java.lang.String logicalName, int position, java.util.List parameters, org.springframework.core.convert.ConversionService conversionService, boolean allowJoins, boolean hibernateCompatible) |
|
public int |
handle(PersistentEntity entity, Criterion criterion, java.lang.StringBuilder q, java.lang.StringBuilder whereClause, java.lang.String logicalName, int position, java.util.List parameters, org.springframework.core.convert.ConversionService conversionService, boolean allowJoins, boolean hibernateCompatible) |
|
public int |
handle(PersistentEntity entity, Criterion criterion, java.lang.StringBuilder q, java.lang.StringBuilder whereClause, java.lang.String logicalName, int position, java.util.List parameters, org.springframework.core.convert.ConversionService conversionService, boolean allowJoins, boolean hibernateCompatible) |
|
public int |
handle(PersistentEntity entity, Criterion criterion, java.lang.StringBuilder q, java.lang.StringBuilder whereClause, java.lang.String logicalName, int position, java.util.List parameters, org.springframework.core.convert.ConversionService conversionService, boolean allowJoins, boolean hibernateCompatible) |
|
public int |
handle(PersistentEntity entity, Criterion criterion, java.lang.StringBuilder q, java.lang.StringBuilder whereClause, java.lang.String logicalName, int position, java.util.List parameters, org.springframework.core.convert.ConversionService conversionService, boolean allowJoins, boolean hibernateCompatible) |
|
public int |
handle(PersistentEntity entity, Criterion criterion, java.lang.StringBuilder q, java.lang.StringBuilder whereClause, java.lang.String logicalName, int position, java.util.List parameters, org.springframework.core.convert.ConversionService conversionService, boolean allowJoins, boolean hibernateCompatible) |
|
public int |
handle(PersistentEntity entity, Criterion criterion, java.lang.StringBuilder q, java.lang.StringBuilder whereClause, java.lang.String logicalName, int position, java.util.List parameters, org.springframework.core.convert.ConversionService conversionService, boolean allowJoins, boolean hibernateCompatible) |
|
public int |
handle(PersistentEntity entity, Criterion criterion, java.lang.StringBuilder q, java.lang.StringBuilder whereClause, java.lang.String logicalName, int position, java.util.List parameters, org.springframework.core.convert.ConversionService conversionService, boolean allowJoins, boolean hibernateCompatible) |
|
public int |
handle(PersistentEntity entity, Criterion criterion, java.lang.StringBuilder q, java.lang.StringBuilder whereClause, java.lang.String logicalName, int position, java.util.List parameters, org.springframework.core.convert.ConversionService conversionService, boolean allowJoins, boolean hibernateCompatible) |
|
public int |
handle(PersistentEntity entity, Criterion criterion, java.lang.StringBuilder q, java.lang.StringBuilder whereClause, java.lang.String logicalName, int position, java.util.List parameters, org.springframework.core.convert.ConversionService conversionService, boolean allowJoins, boolean hibernateCompatible) |
|
public int |
handle(PersistentEntity entity, Criterion criterion, java.lang.StringBuilder q, java.lang.StringBuilder whereClause, java.lang.String logicalName, int position, java.util.List parameters, org.springframework.core.convert.ConversionService conversionService, boolean allowJoins, boolean hibernateCompatible) |
|
public int |
handle(PersistentEntity entity, Criterion criterion, java.lang.StringBuilder q, java.lang.StringBuilder whereClause, java.lang.String logicalName, int position, java.util.List parameters, org.springframework.core.convert.ConversionService conversionService, boolean allowJoins, boolean hibernateCompatible) |
|
public int |
handle(PersistentEntity entity, Criterion criterion, java.lang.StringBuilder q, java.lang.StringBuilder whereClause, java.lang.String logicalName, int position, java.util.List parameters, org.springframework.core.convert.ConversionService conversionService, boolean allowJoins, boolean hibernateCompatible) |
|
public int |
handle(PersistentEntity entity, Criterion criterion, java.lang.StringBuilder q, java.lang.StringBuilder whereClause, java.lang.String logicalName, int position, java.util.List parameters, org.springframework.core.convert.ConversionService conversionService, boolean allowJoins, boolean hibernateCompatible) |
|
public int |
handle(PersistentEntity entity, Criterion criterion, java.lang.StringBuilder q, java.lang.StringBuilder whereClause, java.lang.String logicalName, int position, java.util.List parameters, org.springframework.core.convert.ConversionService conversionService, boolean allowJoins, boolean hibernateCompatible) |
|
public int |
handle(PersistentEntity entity, Criterion criterion, java.lang.StringBuilder q, java.lang.StringBuilder whereClause, java.lang.String logicalName, int position, java.util.List parameters, org.springframework.core.convert.ConversionService conversionService, boolean allowJoins, boolean hibernateCompatible) |
|
public int |
handle(PersistentEntity entity, Criterion criterion, java.lang.StringBuilder q, java.lang.StringBuilder whereClause, java.lang.String logicalName, int position, java.util.List parameters, org.springframework.core.convert.ConversionService conversionService, boolean allowJoins, boolean hibernateCompatible) |
|
public int |
handle(PersistentEntity entity, Criterion criterion, java.lang.StringBuilder q, java.lang.StringBuilder whereClause, java.lang.String logicalName, int position, java.util.List parameters, org.springframework.core.convert.ConversionService conversionService, boolean allowJoins, boolean hibernateCompatible) |
|
public int |
handle(PersistentEntity entity, Criterion criterion, java.lang.StringBuilder q, java.lang.StringBuilder whereClause, java.lang.String logicalName, int position, java.util.List parameters, org.springframework.core.convert.ConversionService conversionService, boolean allowJoins, boolean hibernateCompatible) |
|
public int |
handle(PersistentEntity entity, Criterion criterion, java.lang.StringBuilder q, java.lang.StringBuilder whereClause, java.lang.String logicalName, int position, java.util.List parameters, org.springframework.core.convert.ConversionService conversionService, boolean allowJoins, boolean hibernateCompatible) |
|
public int |
handle(PersistentEntity entity, Criterion criterion, java.lang.StringBuilder q, java.lang.StringBuilder whereClause, java.lang.String logicalName, int position, java.util.List parameters, org.springframework.core.convert.ConversionService conversionService, boolean allowJoins, boolean hibernateCompatible) |
|
public int |
handle(PersistentEntity entity, Criterion criterion, java.lang.StringBuilder q, java.lang.StringBuilder whereClause, java.lang.String logicalName, int position, java.util.List parameters, org.springframework.core.convert.ConversionService conversionService, boolean allowJoins, boolean hibernateCompatible) |
|
public int |
handle(PersistentEntity entity, Criterion criterion, java.lang.StringBuilder q, java.lang.StringBuilder whereClause, java.lang.String logicalName, int position, java.util.List parameters, org.springframework.core.convert.ConversionService conversionService, boolean allowJoins, boolean hibernateCompatible) |
|
public int |
handle(PersistentEntity entity, Criterion criterion, java.lang.StringBuilder q, java.lang.StringBuilder whereClause, java.lang.String logicalName, int position, java.util.List parameters, org.springframework.core.convert.ConversionService conversionService, boolean allowJoins, boolean hibernateCompatible) |
|
public int |
handle(PersistentEntity entity, Criterion criterion, java.lang.StringBuilder q, java.lang.StringBuilder whereClause, java.lang.String logicalName, int position, java.util.List parameters, org.springframework.core.convert.ConversionService conversionService, boolean allowJoins, boolean hibernateCompatible) |
|
private static int |
handleAssociationCriteria(java.lang.StringBuilder query, java.lang.StringBuilder whereClause, java.lang.String logicalName, int position, java.util.List parameters, org.springframework.core.convert.ConversionService conversionService, boolean allowJoins, Association<?> association, Junction associationCriteria, java.util.List<Query.Criterion> associationCriteriaList, boolean hibernateCompatible) |
|
protected static int |
handleSubQuery(PersistentEntity entity, java.lang.StringBuilder q, java.lang.StringBuilder whereClause, java.lang.String logicalName, int position, java.util.List parameters, org.springframework.core.convert.ConversionService conversionService, boolean allowJoins, boolean hibernateCompatible, SubqueryCriterion equalsAll, java.lang.String comparisonExpression) |
|
public void |
setConversionService(org.springframework.core.convert.ConversionService conversionService) |
|
public void |
setHibernateCompatible(boolean hibernateCompatible) |
|
private static PersistentProperty |
validateProperty(PersistentEntity entity, java.lang.String name, java.lang.Class criterionType) |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Builds a DELETE statement
Builds SELECT statement
Builds an UPDATE statement.
propertiesToUpdate
- THe properties to update