| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| SuffixableQueryByCriteria |
|
| 1.0;1 |
| 1 | /* | |
| 2 | * Copyright 2007-2008 The Kuali Foundation | |
| 3 | * | |
| 4 | * Licensed under the Educational Community License, Version 2.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/ecl2.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.framework.persistence.ojb; | |
| 17 | ||
| 18 | import org.apache.ojb.broker.query.Criteria; | |
| 19 | import org.apache.ojb.broker.query.QueryByCriteria; | |
| 20 | ||
| 21 | /** | |
| 22 | * QueryByCriteria subclass that introduces a suffix that the SqlGenerator should | |
| 23 | * append onto the end of the generated sql statement. | |
| 24 | * This is a hack to introduce select-for-update functionality into OJB so the same ORM/Criteria abstractions | |
| 25 | * can be retained for select-for-update queries. Select for update appears to have been added in the OJB | |
| 26 | * source repository, so maybe a forthcoming release will include this functionality and these kludges can be | |
| 27 | * removed. | |
| 28 | * @author Kuali Rice Team (rice.collab@kuali.org) | |
| 29 | */ | |
| 30 | public class SuffixableQueryByCriteria extends QueryByCriteria { | |
| 31 | protected String suffix; | |
| 32 | ||
| 33 | public SuffixableQueryByCriteria(Class targetClass, Criteria criteria, boolean distinct) { | |
| 34 | 0 | super(targetClass, criteria, distinct); |
| 35 | 0 | } |
| 36 | ||
| 37 | public SuffixableQueryByCriteria(Class targetClass, Criteria whereCriteria, Criteria havingCriteria, boolean distinct) { | |
| 38 | 0 | super(targetClass, whereCriteria, havingCriteria, distinct); |
| 39 | 0 | } |
| 40 | ||
| 41 | public SuffixableQueryByCriteria(Class targetClass, Criteria whereCriteria, Criteria havingCriteria) { | |
| 42 | 0 | super(targetClass, whereCriteria, havingCriteria); |
| 43 | 0 | } |
| 44 | ||
| 45 | public SuffixableQueryByCriteria(Class targetClass, Criteria criteria) { | |
| 46 | 0 | super(targetClass, criteria); |
| 47 | 0 | } |
| 48 | ||
| 49 | public SuffixableQueryByCriteria(Class classToSearchFrom) { | |
| 50 | 0 | super(classToSearchFrom); |
| 51 | 0 | } |
| 52 | ||
| 53 | public SuffixableQueryByCriteria(Object anObject, boolean distinct) { | |
| 54 | 0 | super(anObject, distinct); |
| 55 | 0 | } |
| 56 | ||
| 57 | public SuffixableQueryByCriteria(Object anObject) { | |
| 58 | 0 | super(anObject); |
| 59 | 0 | } |
| 60 | ||
| 61 | public void setQuerySuffix(String suffix) { | |
| 62 | 0 | this.suffix = suffix; |
| 63 | 0 | } |
| 64 | ||
| 65 | public String getQuerySuffix() { | |
| 66 | 0 | return suffix; |
| 67 | } | |
| 68 | } |