|
|||||||||||||||||||
30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover | |||||||||||||||||||
Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
LogCriteria.java | - | 0% | 0% | 0% |
|
1 |
/*
|
|
2 |
* Joey and its relative products are published under the terms
|
|
3 |
* of the Apache Software License.
|
|
4 |
*/
|
|
5 |
/*
|
|
6 |
* Created on 2004/02/29
|
|
7 |
*/
|
|
8 |
package org.asyrinx.brownie.hibernate.logger;
|
|
9 |
|
|
10 |
import java.util.List;
|
|
11 |
|
|
12 |
import net.sf.hibernate.Criteria;
|
|
13 |
import net.sf.hibernate.FetchMode;
|
|
14 |
import net.sf.hibernate.HibernateException;
|
|
15 |
import net.sf.hibernate.LockMode;
|
|
16 |
import net.sf.hibernate.expression.Criterion;
|
|
17 |
import net.sf.hibernate.expression.Order;
|
|
18 |
|
|
19 |
import org.asyrinx.brownie.core.log.CascadeNamedLog;
|
|
20 |
import org.asyrinx.brownie.hibernate.wrapper.CriteriaWrapper;
|
|
21 |
|
|
22 |
/**
|
|
23 |
* @author akima
|
|
24 |
*/
|
|
25 |
public class LogCriteria extends CriteriaWrapper { |
|
26 |
|
|
27 |
/**
|
|
28 |
* @param wrapped
|
|
29 |
* @param log
|
|
30 |
*/
|
|
31 | 0 |
public LogCriteria(Criteria wrapped, CascadeNamedLog parentLog) {
|
32 | 0 |
super(wrapped);
|
33 | 0 |
this.log = parentLog.subLog(wrapped);
|
34 |
} |
|
35 |
|
|
36 |
protected final CascadeNamedLog log;
|
|
37 |
|
|
38 | 0 |
private Criteria toLogged(Criteria criteria) {
|
39 | 0 |
return new LogCriteria(criteria, log); |
40 |
} |
|
41 |
|
|
42 |
/**
|
|
43 |
* @see net.sf.hibernate.Criteria#add(net.sf.hibernate.expression.Criterion)
|
|
44 |
*/
|
|
45 | 0 |
public Criteria add(Criterion criterion) {
|
46 | 0 |
log.log("add( " + criterion + " )"); |
47 | 0 |
return toLogged(super.add(criterion)); |
48 |
} |
|
49 |
|
|
50 |
/**
|
|
51 |
* @see net.sf.hibernate.Criteria#addOrder(net.sf.hibernate.expression.Order)
|
|
52 |
*/
|
|
53 | 0 |
public Criteria addOrder(Order order) {
|
54 | 0 |
log.log("addOrder( " + order + " )"); |
55 | 0 |
return toLogged(super.addOrder(order)); |
56 |
} |
|
57 |
|
|
58 |
/**
|
|
59 |
* @see net.sf.hibernate.Criteria#createAlias(java.lang.String,
|
|
60 |
* java.lang.String)
|
|
61 |
*/
|
|
62 | 0 |
public Criteria createAlias(String associationPath, String alias)
|
63 |
throws HibernateException {
|
|
64 | 0 |
log.log("createAlias( " + associationPath + "," + alias + " )"); |
65 | 0 |
return toLogged(super.createAlias(associationPath, alias)); |
66 |
} |
|
67 |
|
|
68 |
/**
|
|
69 |
* @see net.sf.hibernate.Criteria#createCriteria(java.lang.String,
|
|
70 |
* java.lang.String)
|
|
71 |
*/
|
|
72 | 0 |
public Criteria createCriteria(String associationPath, String alias)
|
73 |
throws HibernateException {
|
|
74 | 0 |
log.log("createCriteria( " + associationPath + "," + alias + " )"); |
75 | 0 |
return toLogged(super.createCriteria(associationPath, alias)); |
76 |
} |
|
77 |
|
|
78 |
/**
|
|
79 |
* @see net.sf.hibernate.Criteria#createCriteria(java.lang.String)
|
|
80 |
*/
|
|
81 | 0 |
public Criteria createCriteria(String associationPath)
|
82 |
throws HibernateException {
|
|
83 | 0 |
log.log("createCriteria( " + associationPath + " )"); |
84 | 0 |
return toLogged(super.createCriteria(associationPath)); |
85 |
} |
|
86 |
|
|
87 |
/**
|
|
88 |
* @see net.sf.hibernate.Criteria#getCriteriaClass()
|
|
89 |
*/
|
|
90 | 0 |
public Class getCriteriaClass() {
|
91 | 0 |
return super.getCriteriaClass(); |
92 |
} |
|
93 |
|
|
94 |
/**
|
|
95 |
* @see net.sf.hibernate.Criteria#getCriteriaClass(java.lang.String)
|
|
96 |
*/
|
|
97 | 0 |
public Class getCriteriaClass(String alias) {
|
98 | 0 |
return super.getCriteriaClass(alias); |
99 |
} |
|
100 |
|
|
101 |
/**
|
|
102 |
* @see net.sf.hibernate.Criteria#list()
|
|
103 |
*/
|
|
104 | 0 |
public List list() throws HibernateException { |
105 | 0 |
log.log("list()");
|
106 | 0 |
return super.list(); |
107 |
} |
|
108 |
|
|
109 |
/**
|
|
110 |
* @see net.sf.hibernate.Criteria#returnMaps()
|
|
111 |
* @deprecated
|
|
112 |
*/
|
|
113 | 0 |
public Criteria returnMaps() {
|
114 | 0 |
log.log("returnMaps()");
|
115 | 0 |
return toLogged(super.returnMaps()); |
116 |
} |
|
117 |
|
|
118 |
/**
|
|
119 |
* @see net.sf.hibernate.Criteria#returnRootEntities()
|
|
120 |
* @deprecated
|
|
121 |
*/
|
|
122 | 0 |
public Criteria returnRootEntities() {
|
123 | 0 |
log.log("returnRootEntities()");
|
124 | 0 |
return toLogged(super.returnRootEntities()); |
125 |
} |
|
126 |
|
|
127 |
/**
|
|
128 |
* @see net.sf.hibernate.Criteria#setFetchMode(java.lang.String,
|
|
129 |
* net.sf.hibernate.FetchMode)
|
|
130 |
*/
|
|
131 | 0 |
public Criteria setFetchMode(String associationPath, FetchMode mode)
|
132 |
throws HibernateException {
|
|
133 | 0 |
log.log("setFetchMode( " + associationPath + "," + mode + " )"); |
134 | 0 |
return toLogged(super.setFetchMode(associationPath, mode)); |
135 |
} |
|
136 |
|
|
137 |
/**
|
|
138 |
* @see net.sf.hibernate.Criteria#setFirstResult(int)
|
|
139 |
*/
|
|
140 | 0 |
public Criteria setFirstResult(int firstResult) { |
141 | 0 |
log.log("setFirstResult( " + firstResult + " )"); |
142 | 0 |
return toLogged(super.setFirstResult(firstResult)); |
143 |
} |
|
144 |
|
|
145 |
/**
|
|
146 |
* @see net.sf.hibernate.Criteria#setLockMode(net.sf.hibernate.LockMode)
|
|
147 |
*/
|
|
148 | 0 |
public Criteria setLockMode(LockMode lockMode) {
|
149 | 0 |
log.log("setLockMode( " + lockMode + " )"); |
150 | 0 |
return toLogged(super.setLockMode(lockMode)); |
151 |
} |
|
152 |
|
|
153 |
/**
|
|
154 |
* @see net.sf.hibernate.Criteria#setLockMode(java.lang.String,
|
|
155 |
* net.sf.hibernate.LockMode)
|
|
156 |
*/
|
|
157 | 0 |
public Criteria setLockMode(String alias, LockMode lockMode) {
|
158 | 0 |
log.log("setLockMode( " + alias + ", " + lockMode + " )"); |
159 | 0 |
return toLogged(super.setLockMode(alias, lockMode)); |
160 |
} |
|
161 |
|
|
162 |
/**
|
|
163 |
* @see net.sf.hibernate.Criteria#setMaxResults(int)
|
|
164 |
*/
|
|
165 | 0 |
public Criteria setMaxResults(int maxResults) { |
166 | 0 |
log.log("setMaxResults( " + maxResults + " )"); |
167 | 0 |
return toLogged(super.setMaxResults(maxResults)); |
168 |
} |
|
169 |
|
|
170 |
/**
|
|
171 |
* @see net.sf.hibernate.Criteria#setTimeout(int)
|
|
172 |
*/
|
|
173 | 0 |
public Criteria setTimeout(int timeout) { |
174 | 0 |
log.log("setTimeout( " + timeout + " )"); |
175 | 0 |
return toLogged(super.setTimeout(timeout)); |
176 |
} |
|
177 |
|
|
178 |
/**
|
|
179 |
* @see net.sf.hibernate.Criteria#uniqueResult()
|
|
180 |
*/
|
|
181 | 0 |
public Object uniqueResult() throws HibernateException { |
182 | 0 |
log.log("uniqueResult()");
|
183 | 0 |
return super.uniqueResult(); |
184 |
} |
|
185 |
|
|
186 |
} |
|