HHH-4758 - Rename org.hibernate.ejb.criteria.AbstractNode#queryBuilder to #criteriaBuilder
git-svn-id: https://svn.jboss.org/repos/hibernate/core/trunk@18445 1b8cb986-b30d-0410-93ca-fae66ebed9b2
This commit is contained in:
parent
ef30ca4408
commit
415c9e9ec3
|
@ -43,7 +43,7 @@ public class AbstractNode implements Serializable {
|
|||
*
|
||||
* @return The underlying {@link CriteriaBuilderImpl} instance.
|
||||
*/
|
||||
protected CriteriaBuilderImpl queryBuilder() {
|
||||
protected CriteriaBuilderImpl criteriaBuilder() {
|
||||
return criteriaBuilder;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -124,10 +124,10 @@ public class CriteriaQueryImpl<T> extends AbstractNode implements CriteriaQuery<
|
|||
final Selection<? extends T> selection;
|
||||
|
||||
if ( Tuple.class.isAssignableFrom( getResultType() ) ) {
|
||||
selection = ( Selection<? extends T> ) queryBuilder().tuple( selections );
|
||||
selection = ( Selection<? extends T> ) criteriaBuilder().tuple( selections );
|
||||
}
|
||||
else if ( getResultType().isArray() ) {
|
||||
selection = ( Selection<? extends T> ) queryBuilder().array(
|
||||
selection = ( Selection<? extends T> ) criteriaBuilder().array(
|
||||
( Class<? extends Object[]> ) getResultType(),
|
||||
selections
|
||||
);
|
||||
|
@ -144,12 +144,12 @@ public class CriteriaQueryImpl<T> extends AbstractNode implements CriteriaQuery<
|
|||
break;
|
||||
}
|
||||
default: {
|
||||
selection = ( Selection<? extends T> ) queryBuilder().array( selections );
|
||||
selection = ( Selection<? extends T> ) criteriaBuilder().array( selections );
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
selection = queryBuilder().construct( getResultType(), selections );
|
||||
selection = criteriaBuilder().construct( getResultType(), selections );
|
||||
}
|
||||
applySelection( selection );
|
||||
return this;
|
||||
|
@ -193,7 +193,7 @@ public class CriteriaQueryImpl<T> extends AbstractNode implements CriteriaQuery<
|
|||
* {@inheritDoc}
|
||||
*/
|
||||
public CriteriaQuery<T> where(Expression<Boolean> expression) {
|
||||
queryStructure.setRestriction( queryBuilder().wrap( expression ) );
|
||||
queryStructure.setRestriction( criteriaBuilder().wrap( expression ) );
|
||||
return this;
|
||||
}
|
||||
|
||||
|
@ -202,7 +202,7 @@ public class CriteriaQueryImpl<T> extends AbstractNode implements CriteriaQuery<
|
|||
*/
|
||||
public CriteriaQuery<T> where(Predicate... predicates) {
|
||||
// TODO : assuming this should be a conjuntion, but the spec does not say specifically...
|
||||
queryStructure.setRestriction( queryBuilder().and( predicates ) );
|
||||
queryStructure.setRestriction( criteriaBuilder().and( predicates ) );
|
||||
return this;
|
||||
}
|
||||
|
||||
|
@ -240,7 +240,7 @@ public class CriteriaQueryImpl<T> extends AbstractNode implements CriteriaQuery<
|
|||
* {@inheritDoc}
|
||||
*/
|
||||
public CriteriaQuery<T> having(Expression<Boolean> expression) {
|
||||
queryStructure.setHaving( queryBuilder().wrap( expression ) );
|
||||
queryStructure.setHaving( criteriaBuilder().wrap( expression ) );
|
||||
return this;
|
||||
}
|
||||
|
||||
|
@ -248,7 +248,7 @@ public class CriteriaQueryImpl<T> extends AbstractNode implements CriteriaQuery<
|
|||
* {@inheritDoc}
|
||||
*/
|
||||
public CriteriaQuery<T> having(Predicate... predicates) {
|
||||
queryStructure.setHaving( queryBuilder().and( predicates ) );
|
||||
queryStructure.setHaving( criteriaBuilder().and( predicates ) );
|
||||
return this;
|
||||
}
|
||||
|
||||
|
|
|
@ -167,7 +167,7 @@ public class CriteriaSubqueryImpl<T> extends ExpressionImpl<T> implements Subque
|
|||
* {@inheritDoc}
|
||||
*/
|
||||
public Subquery<T> where(Expression<Boolean> expression) {
|
||||
queryStructure.setRestriction( queryBuilder().wrap( expression ) );
|
||||
queryStructure.setRestriction( criteriaBuilder().wrap( expression ) );
|
||||
return this;
|
||||
}
|
||||
|
||||
|
@ -176,7 +176,7 @@ public class CriteriaSubqueryImpl<T> extends ExpressionImpl<T> implements Subque
|
|||
*/
|
||||
public Subquery<T> where(Predicate... predicates) {
|
||||
// TODO : assuming this should be a conjuntion, but the spec does not say specifically...
|
||||
queryStructure.setRestriction( queryBuilder().and( predicates ) );
|
||||
queryStructure.setRestriction( criteriaBuilder().and( predicates ) );
|
||||
return this;
|
||||
}
|
||||
|
||||
|
@ -218,7 +218,7 @@ public class CriteriaSubqueryImpl<T> extends ExpressionImpl<T> implements Subque
|
|||
* {@inheritDoc}
|
||||
*/
|
||||
public Subquery<T> having(Expression<Boolean> expression) {
|
||||
queryStructure.setHaving( queryBuilder().wrap( expression ) );
|
||||
queryStructure.setHaving( criteriaBuilder().wrap( expression ) );
|
||||
return this;
|
||||
}
|
||||
|
||||
|
@ -226,7 +226,7 @@ public class CriteriaSubqueryImpl<T> extends ExpressionImpl<T> implements Subque
|
|||
* {@inheritDoc}
|
||||
*/
|
||||
public Subquery<T> having(Predicate... predicates) {
|
||||
queryStructure.setHaving( queryBuilder().and( predicates ) );
|
||||
queryStructure.setHaving( criteriaBuilder().and( predicates ) );
|
||||
return this;
|
||||
}
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ public class CoalesceExpression<T> extends ExpressionImpl<T> implements Coalesce
|
|||
}
|
||||
|
||||
public Coalesce<T> value(T value) {
|
||||
return value( new LiteralExpression<T>( queryBuilder(), value ) );
|
||||
return value( new LiteralExpression<T>( criteriaBuilder(), value ) );
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "unchecked" })
|
||||
|
|
|
@ -53,49 +53,49 @@ public abstract class ExpressionImpl<T>
|
|||
public <X> Expression<X> as(Class<X> type) {
|
||||
return type.equals( getJavaType() )
|
||||
? (Expression<X>) this
|
||||
: new CastFunction<X, T>( queryBuilder(), type, this );
|
||||
: new CastFunction<X, T>( criteriaBuilder(), type, this );
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public Predicate isNull() {
|
||||
return queryBuilder().isNull( this );
|
||||
return criteriaBuilder().isNull( this );
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public Predicate isNotNull() {
|
||||
return queryBuilder().isNotNull( this );
|
||||
return criteriaBuilder().isNotNull( this );
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public Predicate in(Object... values) {
|
||||
return queryBuilder().in( this, values );
|
||||
return criteriaBuilder().in( this, values );
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public Predicate in(Expression<?>... values) {
|
||||
return queryBuilder().in( this, values );
|
||||
return criteriaBuilder().in( this, values );
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public Predicate in(Collection<?> values) {
|
||||
return queryBuilder().in( this, values );
|
||||
return criteriaBuilder().in( this, values );
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public Predicate in(Expression<Collection<?>> values) {
|
||||
return queryBuilder().in( this, values );
|
||||
return criteriaBuilder().in( this, values );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -86,7 +86,7 @@ public class SearchedCaseExpression<R>
|
|||
final Class<R> type = result != null
|
||||
? (Class<R>) result.getClass()
|
||||
: getJavaType();
|
||||
return new LiteralExpression<R>( queryBuilder(), type, result );
|
||||
return new LiteralExpression<R>( criteriaBuilder(), type, result );
|
||||
}
|
||||
|
||||
public Case<R> when(Expression<Boolean> condition, Expression<? extends R> result) {
|
||||
|
|
|
@ -94,7 +94,7 @@ public class SimpleCaseExpression<C,R>
|
|||
final Class<R> type = result != null
|
||||
? (Class<R>) result.getClass()
|
||||
: getJavaType();
|
||||
return new LiteralExpression<R>( queryBuilder(), type, result );
|
||||
return new LiteralExpression<R>( criteriaBuilder(), type, result );
|
||||
}
|
||||
|
||||
public SimpleCase<C, R> when(C condition, Expression<? extends R> result) {
|
||||
|
|
|
@ -236,7 +236,7 @@ public abstract class AbstractFromImpl<Z,X>
|
|||
|
||||
final Class<Y> attributeType = attribute.getBindableJavaType();
|
||||
return new SingularAttributeJoin<X,Y>(
|
||||
queryBuilder(),
|
||||
criteriaBuilder(),
|
||||
attributeType,
|
||||
this,
|
||||
attribute,
|
||||
|
@ -272,7 +272,7 @@ public abstract class AbstractFromImpl<Z,X>
|
|||
|
||||
final Class<Y> attributeType = collection.getBindableJavaType();
|
||||
return new CollectionAttributeJoin<X, Y>(
|
||||
queryBuilder(),
|
||||
criteriaBuilder(),
|
||||
attributeType,
|
||||
this,
|
||||
collection,
|
||||
|
@ -308,7 +308,7 @@ public abstract class AbstractFromImpl<Z,X>
|
|||
// TODO : runtime check that the attribute in fact belongs to this From's model/bindable
|
||||
|
||||
final Class<Y> attributeType = set.getBindableJavaType();
|
||||
return new SetAttributeJoin<X,Y>( queryBuilder(), attributeType, this, set, jt );
|
||||
return new SetAttributeJoin<X,Y>( criteriaBuilder(), attributeType, this, set, jt );
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -339,7 +339,7 @@ public abstract class AbstractFromImpl<Z,X>
|
|||
// TODO : runtime check that the attribute in fact belongs to this From's model/bindable
|
||||
|
||||
final Class<Y> attributeType = list.getBindableJavaType();
|
||||
return new ListAttributeJoin<X,Y>( queryBuilder(), attributeType, this, list, jt );
|
||||
return new ListAttributeJoin<X,Y>( criteriaBuilder(), attributeType, this, list, jt );
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -370,7 +370,7 @@ public abstract class AbstractFromImpl<Z,X>
|
|||
// TODO : runtime check that the attribute in fact belongs to this From's model/bindable
|
||||
|
||||
final Class<V> attributeType = map.getBindableJavaType();
|
||||
return new MapAttributeJoin<X, K, V>( queryBuilder(), attributeType, this, map, jt );
|
||||
return new MapAttributeJoin<X, K, V>( criteriaBuilder(), attributeType, this, map, jt );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -69,7 +69,7 @@ public abstract class AbstractPathImpl<X>
|
|||
PathSource pathSource) {
|
||||
super( criteriaBuilder, javaType );
|
||||
this.pathSource = pathSource;
|
||||
this.typeExpression = new PathTypeExpression( queryBuilder(), getJavaType() );
|
||||
this.typeExpression = new PathTypeExpression( criteriaBuilder(), getJavaType() );
|
||||
}
|
||||
|
||||
public PathSource getPathSource() {
|
||||
|
@ -137,7 +137,7 @@ public abstract class AbstractPathImpl<X>
|
|||
|
||||
SingularAttributePath<Y> path = (SingularAttributePath<Y>) resolveCachedAttributePath( attribute.getName() );
|
||||
if ( path == null ) {
|
||||
path = new SingularAttributePath<Y>( queryBuilder(), attribute.getJavaType(), this, attribute );
|
||||
path = new SingularAttributePath<Y>( criteriaBuilder(), attribute.getJavaType(), this, attribute );
|
||||
registerAttributePath( attribute.getName(), path );
|
||||
}
|
||||
return path;
|
||||
|
@ -154,7 +154,7 @@ public abstract class AbstractPathImpl<X>
|
|||
|
||||
PluralAttributePath<C> path = (PluralAttributePath<C>) resolveCachedAttributePath( attribute.getName() );
|
||||
if ( path == null ) {
|
||||
path = new PluralAttributePath<C>( queryBuilder(), this, attribute );
|
||||
path = new PluralAttributePath<C>( criteriaBuilder(), this, attribute );
|
||||
registerAttributePath( attribute.getName(), path );
|
||||
}
|
||||
return path;
|
||||
|
@ -171,7 +171,7 @@ public abstract class AbstractPathImpl<X>
|
|||
|
||||
PluralAttributePath path = (PluralAttributePath) resolveCachedAttributePath( attribute.getName() );
|
||||
if ( path == null ) {
|
||||
path = new PluralAttributePath( queryBuilder(), this, attribute );
|
||||
path = new PluralAttributePath( criteriaBuilder(), this, attribute );
|
||||
registerAttributePath( attribute.getName(), path );
|
||||
}
|
||||
return path;
|
||||
|
|
|
@ -70,7 +70,7 @@ public class CollectionAttributeJoin<O,E>
|
|||
@Override
|
||||
protected FromImplementor<O, E> createCorrelationDelegate() {
|
||||
return new CollectionAttributeJoin<O,E>(
|
||||
queryBuilder(),
|
||||
criteriaBuilder(),
|
||||
getJavaType(),
|
||||
(PathImplementor<O>) getParentPath(),
|
||||
getAttribute(),
|
||||
|
|
|
@ -60,7 +60,7 @@ public class ListAttributeJoin<O,E>
|
|||
* {@inheritDoc}
|
||||
*/
|
||||
public Expression<Integer> index() {
|
||||
return new ListIndexExpression( queryBuilder(), this, getAttribute() );
|
||||
return new ListIndexExpression( criteriaBuilder(), this, getAttribute() );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -81,7 +81,7 @@ public class ListAttributeJoin<O,E>
|
|||
@Override
|
||||
protected FromImplementor<O, E> createCorrelationDelegate() {
|
||||
return new ListAttributeJoin<O,E>(
|
||||
queryBuilder(),
|
||||
criteriaBuilder(),
|
||||
getJavaType(),
|
||||
(PathImplementor<O>) getParentPath(),
|
||||
getAttribute(),
|
||||
|
|
|
@ -75,7 +75,7 @@ public class MapAttributeJoin<O,K,V>
|
|||
@Override
|
||||
protected FromImplementor<O, V> createCorrelationDelegate() {
|
||||
return new MapAttributeJoin<O,K,V>(
|
||||
queryBuilder(),
|
||||
criteriaBuilder(),
|
||||
getJavaType(),
|
||||
(PathImplementor<O>) getParentPath(),
|
||||
getAttribute(),
|
||||
|
@ -96,7 +96,7 @@ public class MapAttributeJoin<O,K,V>
|
|||
*/
|
||||
@SuppressWarnings({ "unchecked" })
|
||||
public Expression<Map.Entry<K, V>> entry() {
|
||||
return new MapEntryExpression( queryBuilder(), Map.Entry.class, this, getAttribute() );
|
||||
return new MapEntryExpression( criteriaBuilder(), Map.Entry.class, this, getAttribute() );
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -105,13 +105,13 @@ public class MapAttributeJoin<O,K,V>
|
|||
@SuppressWarnings({ "unchecked" })
|
||||
public Path<K> key() {
|
||||
final MapKeyHelpers.MapKeySource<K,V> mapKeySource = new MapKeyHelpers.MapKeySource<K,V>(
|
||||
queryBuilder(),
|
||||
criteriaBuilder(),
|
||||
getAttribute().getJavaType(),
|
||||
this,
|
||||
getAttribute()
|
||||
);
|
||||
final MapKeyHelpers.MapKeyAttribute mapKeyAttribute = new MapKeyHelpers.MapKeyAttribute( queryBuilder(), getAttribute() );
|
||||
return new MapKeyHelpers.MapKeyPath( queryBuilder(), mapKeySource, mapKeyAttribute );
|
||||
final MapKeyHelpers.MapKeyAttribute mapKeyAttribute = new MapKeyHelpers.MapKeyAttribute( criteriaBuilder(), getAttribute() );
|
||||
return new MapKeyHelpers.MapKeyPath( criteriaBuilder(), mapKeySource, mapKeyAttribute );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -57,7 +57,7 @@ public class RootImpl<X> extends AbstractFromImpl<X,X> implements Root<X>, Seria
|
|||
|
||||
@Override
|
||||
protected FromImplementor<X, X> createCorrelationDelegate() {
|
||||
return new RootImpl<X>( queryBuilder(), getEntityType() );
|
||||
return new RootImpl<X>( criteriaBuilder(), getEntityType() );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -72,7 +72,7 @@ public class SetAttributeJoin<O,E>
|
|||
@Override
|
||||
protected FromImplementor<O, E> createCorrelationDelegate() {
|
||||
return new SetAttributeJoin<O,E>(
|
||||
queryBuilder(),
|
||||
criteriaBuilder(),
|
||||
getJavaType(),
|
||||
(PathImplementor<O>) getParentPath(),
|
||||
getAttribute(),
|
||||
|
|
|
@ -69,7 +69,7 @@ public class SingularAttributeJoin<Z,X> extends AbstractJoinImpl<Z,X> {
|
|||
@Override
|
||||
protected FromImplementor<Z, X> createCorrelationDelegate() {
|
||||
return new SingularAttributeJoin<Z,X>(
|
||||
queryBuilder(),
|
||||
criteriaBuilder(),
|
||||
getJavaType(),
|
||||
getPathSource(),
|
||||
getAttribute(),
|
||||
|
|
|
@ -143,7 +143,7 @@ public class InPredicate<T>
|
|||
}
|
||||
|
||||
public InPredicate<T> value(T value) {
|
||||
return value( new LiteralExpression<T>( queryBuilder(), value ) );
|
||||
return value( new LiteralExpression<T>( criteriaBuilder(), value ) );
|
||||
}
|
||||
|
||||
public InPredicate<T> value(Expression<? extends T> value) {
|
||||
|
|
Loading…
Reference in New Issue