19 package org.turro.jpa.query;
21 import java.util.Collection;
22 import java.util.List;
25 import javax.persistence.criteria.CollectionJoin;
26 import javax.persistence.criteria.Expression;
27 import javax.persistence.criteria.Fetch;
28 import javax.persistence.criteria.From;
29 import javax.persistence.criteria.Join;
30 import javax.persistence.criteria.JoinType;
31 import javax.persistence.criteria.ListJoin;
32 import javax.persistence.criteria.MapJoin;
33 import javax.persistence.criteria.Path;
34 import javax.persistence.criteria.Predicate;
35 import javax.persistence.criteria.Root;
36 import javax.persistence.criteria.Selection;
37 import javax.persistence.criteria.SetJoin;
38 import javax.persistence.metamodel.CollectionAttribute;
39 import javax.persistence.metamodel.EntityType;
40 import javax.persistence.metamodel.ListAttribute;
41 import javax.persistence.metamodel.MapAttribute;
42 import javax.persistence.metamodel.PluralAttribute;
43 import javax.persistence.metamodel.SetAttribute;
44 import javax.persistence.metamodel.SingularAttribute;
50 public class JpaRoot<T>
implements Root<T> {
64 return root.getModel();
69 return root.getJoins();
74 return root.isCorrelated();
79 return root.getCorrelationParent();
83 public <Y> Join<T, Y> join(SingularAttribute<? super T, Y> attribute) {
84 return root.join(attribute);
88 public <Y> Join<T, Y> join(SingularAttribute<? super T, Y> attribute, JoinType jt) {
89 return root.join(attribute, jt);
93 public <Y> CollectionJoin<T, Y> join(CollectionAttribute<? super T, Y> collection) {
94 return root.join(collection);
98 public <Y> SetJoin<T, Y> join(SetAttribute<? super T, Y>
set) {
99 return root.join(
set);
103 public <Y> ListJoin<T, Y> join(ListAttribute<? super T, Y> list) {
104 return root.join(list);
108 public <K, V> MapJoin<T, K, V> join(MapAttribute<? super T, K, V> map) {
109 return root.join(map);
113 public <Y> CollectionJoin<T, Y> join(CollectionAttribute<? super T, Y> collection, JoinType jt) {
114 return root.join(collection, jt);
118 public <Y> SetJoin<T, Y> join(SetAttribute<? super T, Y>
set, JoinType jt) {
119 return root.join(
set, jt);
123 public <Y> ListJoin<T, Y> join(ListAttribute<? super T, Y> list, JoinType jt) {
124 return root.join(list, jt);
128 public <K, V> MapJoin<T, K, V> join(MapAttribute<? super T, K, V> map, JoinType jt) {
129 return root.join(map, jt);
133 public <X, Y> Join<X, Y> join(String attributeName) {
134 return root.join(attributeName);
138 public <X, Y> CollectionJoin<X, Y> joinCollection(String attributeName) {
139 return root.joinCollection(attributeName);
143 public <X, Y> SetJoin<X, Y> joinSet(String attributeName) {
144 return root.joinSet(attributeName);
148 public <X, Y> ListJoin<X, Y> joinList(String attributeName) {
149 return root.joinList(attributeName);
153 public <X, K, V> MapJoin<X, K, V> joinMap(String attributeName) {
154 return root.joinMap(attributeName);
158 public <X, Y> Join<X, Y> join(String attributeName, JoinType jt) {
159 return root.join(attributeName, jt);
163 public <X, Y> CollectionJoin<X, Y> joinCollection(String attributeName, JoinType jt) {
164 return root.joinCollection(attributeName, jt);
168 public <X, Y> SetJoin<X, Y> joinSet(String attributeName, JoinType jt) {
169 return root.joinSet(attributeName, jt);
173 public <X, Y> ListJoin<X, Y> joinList(String attributeName, JoinType jt) {
174 return root.joinList(attributeName, jt);
178 public <X, K, V> MapJoin<X, K, V> joinMap(String attributeName, JoinType jt) {
179 return root.joinMap(attributeName, jt);
184 return root.getParentPath();
188 public <Y> Path<Y>
get(SingularAttribute<? super T, Y> attribute) {
189 return root.get(attribute);
193 public <E, C extends Collection<E>> Expression<C>
get(PluralAttribute<T, C, E> collection) {
194 return root.get(collection);
198 public <K, V, M extends Map<K, V>> Expression<M>
get(MapAttribute<T, K, V> map) {
199 return root.get(map);
203 public Expression<Class<? extends T>>
type() {
208 public <Y> Path<Y>
get(String attributeName) {
209 return root.get(attributeName);
214 return root.isNull();
219 return root.isNotNull();
223 public Predicate
in(Object... values) {
224 return root.in(values);
228 public Predicate
in(Expression<?>... values) {
229 return root.in(values);
233 public Predicate
in(Collection<?> values) {
234 return root.in(values);
238 public Predicate
in(Expression<Collection<?>> values) {
239 return root.in(values);
243 public <X> Expression<X> as(Class<X>
type) {
248 public Selection<T>
alias(String name) {
249 return root.alias(name);
254 return root.isCompoundSelection();
259 return root.getCompoundSelectionItems();
264 return root.getJavaType();
269 return root.getAlias();
274 return root.getFetches();
278 public <Y> Fetch<T, Y> fetch(SingularAttribute<? super T, Y> attribute) {
279 return root.fetch(attribute);
283 public <Y> Fetch<T, Y> fetch(SingularAttribute<? super T, Y> attribute, JoinType jt) {
284 return root.fetch(attribute, jt);
288 public <Y> Fetch<T, Y> fetch(PluralAttribute<? super T, ?, Y> attribute) {
289 return root.fetch(attribute);
293 public <Y> Fetch<T, Y> fetch(PluralAttribute<? super T, ?, Y> attribute, JoinType jt) {
294 return root.fetch(attribute, jt);
298 public <X, Y> Fetch<X, Y> fetch(String attributeName) {
299 return root.fetch(attributeName);
303 public <X, Y> Fetch<X, Y> fetch(String attributeName, JoinType jt) {
304 return root.fetch(attributeName, jt);
Set< Join< T, ?> > getJoins()
Class<? extends T > getJavaType()
List< Selection<?> > getCompoundSelectionItems()
Expression< Class<? extends T > > type()
boolean isCompoundSelection()
Selection< T > alias(String name)
Predicate in(Expression<?>... values)
EntityType< T > getModel()
Set< Fetch< T, ?> > getFetches()
From< T, T > getCorrelationParent()
Predicate in(Collection<?> values)
Predicate in(Object... values)
Predicate in(Expression< Collection<?>> values)