org.jbpm.query.jpa.data.QueryWhere Maven / Gradle / Ivy
/*
* Copyright 2017 Red Hat, Inc. and/or its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jbpm.query.jpa.data;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Stack;
import javax.persistence.criteria.Predicate;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
import javax.xml.bind.annotation.XmlRootElement;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
/**
* THIS CLASS SHOULD NEVER BE EXPOSED IN THE PUBLIC API!!
*
* EXTERNAL USE OF THIS CLASS IS **NOT** SUPPORTED!
*
*
* This object can be seen as a (dynamic) representation of the WHERE
part of a query.
*
* It has the following responsibilities:
* - Hold a list of the added query criteria
* - Keep track of the criteria preferences:
* - Are we adding a range, a regexp or just a normal criteria?
* - Is this the start or end of a group?
*
*
*/
@XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD)
// @formatter:off
@JsonIgnoreProperties({"union","type", // transient fields
"currentGroupCriteria", "ancestry", "currentParent",
"addedJoins"})
@JsonAutoDetect(fieldVisibility=Visibility.ANY,
getterVisibility=Visibility.NONE,
setterVisibility=Visibility.NONE,
isGetterVisibility=Visibility.NONE)
// @formatter:on
public class QueryWhere {
@XmlEnum
public static enum QueryCriteriaType {
@XmlEnumValue("N") NORMAL,
@XmlEnumValue("L") REGEXP,
@XmlEnumValue("R") RANGE,
@XmlEnumValue("R") GROUP,
}
@XmlElement(name="queryCriteria")
private List criteria = new LinkedList();
@XmlElement
private Boolean ascOrDesc = null;
@XmlElement
private String orderByListId = null;
@XmlElement
private Integer maxResults = null;
@XmlElement
private Integer offset = null;
@JsonIgnore
private transient boolean union = true;
@JsonIgnore
private transient QueryCriteriaType type = QueryCriteriaType.NORMAL;
@JsonIgnore
private transient List currentCriteria = criteria;
@JsonIgnore
private transient Stack
© 2015 - 2025 Weber Informatics LLC | Privacy Policy