| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| Criteria |
|
| 1.0;1 | ||||
| Criteria$Constants |
|
| 1.0;1 |
| 1 | /* | |
| 2 | * Copyright 2011 The Kuali Foundation | |
| 3 | * | |
| 4 | * Licensed under the Educational Community License, Version 1.0 (the "License"); | |
| 5 | * you may not use this file except in compliance with the License. | |
| 6 | * You may obtain a copy of the License at | |
| 7 | * | |
| 8 | * http://www.opensource.org/licenses/ecl1.php | |
| 9 | * | |
| 10 | * Unless required by applicable law or agreed to in writing, software | |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, | |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| 13 | * See the License for the specific language governing permissions and | |
| 14 | * limitations under the License. | |
| 15 | */ | |
| 16 | package org.kuali.rice.core.api.criteria; | |
| 17 | ||
| 18 | import java.util.List; | |
| 19 | ||
| 20 | import javax.xml.bind.annotation.XmlAccessType; | |
| 21 | import javax.xml.bind.annotation.XmlAccessorType; | |
| 22 | import javax.xml.bind.annotation.XmlRootElement; | |
| 23 | import javax.xml.bind.annotation.XmlType; | |
| 24 | ||
| 25 | /** | |
| 26 | * Defines a criteria statement which will form part of a query. The Criteria | |
| 27 | * is itself a composite expression which represents an implicit "And" on it's | |
| 28 | * list of expressions. | |
| 29 | * | |
| 30 | * <p>To construct a new Criteria instance, the {@link CriteriaBuilder} should | |
| 31 | * be used. Once all expressions have been established on the builder, the | |
| 32 | * {@link CriteriaBuilder#build()} method can be invoked to construct the | |
| 33 | * Criteria. The resulting Criteria object is both immutable and thread-safe, | |
| 34 | * along with all expressions contained therein. | |
| 35 | * | |
| 36 | * <p>A criteria itself could be empty. In which case it is expected that any | |
| 37 | * query performed using that criteria should produce all records of the target | |
| 38 | * data being queried. | |
| 39 | * | |
| 40 | * @see CriteriaBuilder | |
| 41 | * @see QueryByCriteria | |
| 42 | * | |
| 43 | * @author Kuali Rice Team (rice.collab@kuali.org) | |
| 44 | */ | |
| 45 | 0 | @XmlRootElement(name = Criteria.Constants.ROOT_ELEMENT_NAME) |
| 46 | @XmlAccessorType(XmlAccessType.NONE) | |
| 47 | @XmlType(name = Criteria.Constants.TYPE_NAME) | |
| 48 | public final class Criteria extends AbstractCompositeExpression { | |
| 49 | ||
| 50 | private static final long serialVersionUID = -8662772314094715831L; | |
| 51 | ||
| 52 | /** | |
| 53 | * Used only by JAXB. | |
| 54 | */ | |
| 55 | @SuppressWarnings("unused") | |
| 56 | private Criteria() { | |
| 57 | 0 | super(); |
| 58 | 0 | } |
| 59 | ||
| 60 | /** | |
| 61 | * Constructor meant to be used only by the {@link CriteriaBuilder} | |
| 62 | * | |
| 63 | * @param expressions the expressions to use when constructing this criteria, can be null or empty | |
| 64 | * | |
| 65 | * @see AbstractCompositeExpression#AbstractCompositeExpression(List) | |
| 66 | */ | |
| 67 | Criteria(List<Expression> expressions) { | |
| 68 | 0 | super(expressions); |
| 69 | 0 | } |
| 70 | ||
| 71 | /** | |
| 72 | * Defines some internal constants used on this class. | |
| 73 | */ | |
| 74 | 0 | static class Constants { |
| 75 | final static String ROOT_ELEMENT_NAME = "criteria"; | |
| 76 | final static String TYPE_NAME = "CriteriaType"; | |
| 77 | } | |
| 78 | ||
| 79 | } |