org.jbpm.query.jpa.data.QueryCriteria 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.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeInfo.As;
import com.fasterxml.jackson.annotation.JsonTypeInfo.Id;
import org.jbpm.query.jpa.data.QueryWhere.QueryCriteriaType;
import org.kie.internal.query.QueryParameterIdentifiers;
/**
* This object contains the following information:
*
* - The listId, which refers to the field that this criteria applies to
* - See {@link QueryParameterIdentifiers}
*
* - The values of the criteria, which will be applied to the listId field
* - For example, it could be a list of numbers "1, 22, 3"
*
* - Whether this is a union ("OR") or intersection ("AND") critieria
* - The type of criteria: normal, like (JPQL regex) or range
* - The grouping information of the phrase (see below)
*
*
* With regard to the grouping information in this class, we treat JPQL/SQL as a "prefix" language here, which means that
* this class represents the following regular expression/BNF string:
*
* [)]{0,} [OR|AND] [(]{0,} <CRITERIA>
*
* This structure is then represented by the following fields:
*
* [endGroups] [union] [startGroupos] [values]
*
*
* The main reason to include the grouping status in this object is that other data structures (nested lists, etc)
* are much harder to de/serialize correctly.
*/
@XmlRootElement
@XmlType
@XmlAccessorType(XmlAccessType.FIELD)
@JsonIgnoreProperties(value="parameters")
public class QueryCriteria {
@XmlAttribute
private String listId;
@XmlAttribute
private boolean union = true;
@XmlAttribute
private boolean first = false;
@XmlAttribute
private QueryCriteriaType type = QueryCriteriaType.NORMAL;
@XmlElement(name="parameter")
@JsonTypeInfo(use=Id.CLASS, include=As.PROPERTY, property="class")
private List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy