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:
Steve Ebersole 2010-01-07 20:49:36 +00:00
parent ef30ca4408
commit 415c9e9ec3
16 changed files with 44 additions and 44 deletions

View File

@ -43,7 +43,7 @@ public class AbstractNode implements Serializable {
* *
* @return The underlying {@link CriteriaBuilderImpl} instance. * @return The underlying {@link CriteriaBuilderImpl} instance.
*/ */
protected CriteriaBuilderImpl queryBuilder() { protected CriteriaBuilderImpl criteriaBuilder() {
return criteriaBuilder; return criteriaBuilder;
} }
} }

View File

@ -124,10 +124,10 @@ public class CriteriaQueryImpl<T> extends AbstractNode implements CriteriaQuery<
final Selection<? extends T> selection; final Selection<? extends T> selection;
if ( Tuple.class.isAssignableFrom( getResultType() ) ) { if ( Tuple.class.isAssignableFrom( getResultType() ) ) {
selection = ( Selection<? extends T> ) queryBuilder().tuple( selections ); selection = ( Selection<? extends T> ) criteriaBuilder().tuple( selections );
} }
else if ( getResultType().isArray() ) { else if ( getResultType().isArray() ) {
selection = ( Selection<? extends T> ) queryBuilder().array( selection = ( Selection<? extends T> ) criteriaBuilder().array(
( Class<? extends Object[]> ) getResultType(), ( Class<? extends Object[]> ) getResultType(),
selections selections
); );
@ -144,12 +144,12 @@ public class CriteriaQueryImpl<T> extends AbstractNode implements CriteriaQuery<
break; break;
} }
default: { default: {
selection = ( Selection<? extends T> ) queryBuilder().array( selections ); selection = ( Selection<? extends T> ) criteriaBuilder().array( selections );
} }
} }
} }
else { else {
selection = queryBuilder().construct( getResultType(), selections ); selection = criteriaBuilder().construct( getResultType(), selections );
} }
applySelection( selection ); applySelection( selection );
return this; return this;
@ -193,7 +193,7 @@ public class CriteriaQueryImpl<T> extends AbstractNode implements CriteriaQuery<
* {@inheritDoc} * {@inheritDoc}
*/ */
public CriteriaQuery<T> where(Expression<Boolean> expression) { public CriteriaQuery<T> where(Expression<Boolean> expression) {
queryStructure.setRestriction( queryBuilder().wrap( expression ) ); queryStructure.setRestriction( criteriaBuilder().wrap( expression ) );
return this; return this;
} }
@ -202,7 +202,7 @@ public class CriteriaQueryImpl<T> extends AbstractNode implements CriteriaQuery<
*/ */
public CriteriaQuery<T> where(Predicate... predicates) { public CriteriaQuery<T> where(Predicate... predicates) {
// TODO : assuming this should be a conjuntion, but the spec does not say specifically... // 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; return this;
} }
@ -240,7 +240,7 @@ public class CriteriaQueryImpl<T> extends AbstractNode implements CriteriaQuery<
* {@inheritDoc} * {@inheritDoc}
*/ */
public CriteriaQuery<T> having(Expression<Boolean> expression) { public CriteriaQuery<T> having(Expression<Boolean> expression) {
queryStructure.setHaving( queryBuilder().wrap( expression ) ); queryStructure.setHaving( criteriaBuilder().wrap( expression ) );
return this; return this;
} }
@ -248,7 +248,7 @@ public class CriteriaQueryImpl<T> extends AbstractNode implements CriteriaQuery<
* {@inheritDoc} * {@inheritDoc}
*/ */
public CriteriaQuery<T> having(Predicate... predicates) { public CriteriaQuery<T> having(Predicate... predicates) {
queryStructure.setHaving( queryBuilder().and( predicates ) ); queryStructure.setHaving( criteriaBuilder().and( predicates ) );
return this; return this;
} }

View File

@ -167,7 +167,7 @@ public class CriteriaSubqueryImpl<T> extends ExpressionImpl<T> implements Subque
* {@inheritDoc} * {@inheritDoc}
*/ */
public Subquery<T> where(Expression<Boolean> expression) { public Subquery<T> where(Expression<Boolean> expression) {
queryStructure.setRestriction( queryBuilder().wrap( expression ) ); queryStructure.setRestriction( criteriaBuilder().wrap( expression ) );
return this; return this;
} }
@ -176,7 +176,7 @@ public class CriteriaSubqueryImpl<T> extends ExpressionImpl<T> implements Subque
*/ */
public Subquery<T> where(Predicate... predicates) { public Subquery<T> where(Predicate... predicates) {
// TODO : assuming this should be a conjuntion, but the spec does not say specifically... // 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; return this;
} }
@ -218,7 +218,7 @@ public class CriteriaSubqueryImpl<T> extends ExpressionImpl<T> implements Subque
* {@inheritDoc} * {@inheritDoc}
*/ */
public Subquery<T> having(Expression<Boolean> expression) { public Subquery<T> having(Expression<Boolean> expression) {
queryStructure.setHaving( queryBuilder().wrap( expression ) ); queryStructure.setHaving( criteriaBuilder().wrap( expression ) );
return this; return this;
} }
@ -226,7 +226,7 @@ public class CriteriaSubqueryImpl<T> extends ExpressionImpl<T> implements Subque
* {@inheritDoc} * {@inheritDoc}
*/ */
public Subquery<T> having(Predicate... predicates) { public Subquery<T> having(Predicate... predicates) {
queryStructure.setHaving( queryBuilder().and( predicates ) ); queryStructure.setHaving( criteriaBuilder().and( predicates ) );
return this; return this;
} }

View File

@ -60,7 +60,7 @@ public class CoalesceExpression<T> extends ExpressionImpl<T> implements Coalesce
} }
public Coalesce<T> value(T value) { public Coalesce<T> value(T value) {
return value( new LiteralExpression<T>( queryBuilder(), value ) ); return value( new LiteralExpression<T>( criteriaBuilder(), value ) );
} }
@SuppressWarnings({ "unchecked" }) @SuppressWarnings({ "unchecked" })

View File

@ -53,49 +53,49 @@ public abstract class ExpressionImpl<T>
public <X> Expression<X> as(Class<X> type) { public <X> Expression<X> as(Class<X> type) {
return type.equals( getJavaType() ) return type.equals( getJavaType() )
? (Expression<X>) this ? (Expression<X>) this
: new CastFunction<X, T>( queryBuilder(), type, this ); : new CastFunction<X, T>( criteriaBuilder(), type, this );
} }
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
public Predicate isNull() { public Predicate isNull() {
return queryBuilder().isNull( this ); return criteriaBuilder().isNull( this );
} }
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
public Predicate isNotNull() { public Predicate isNotNull() {
return queryBuilder().isNotNull( this ); return criteriaBuilder().isNotNull( this );
} }
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
public Predicate in(Object... values) { public Predicate in(Object... values) {
return queryBuilder().in( this, values ); return criteriaBuilder().in( this, values );
} }
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
public Predicate in(Expression<?>... values) { public Predicate in(Expression<?>... values) {
return queryBuilder().in( this, values ); return criteriaBuilder().in( this, values );
} }
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
public Predicate in(Collection<?> values) { public Predicate in(Collection<?> values) {
return queryBuilder().in( this, values ); return criteriaBuilder().in( this, values );
} }
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
public Predicate in(Expression<Collection<?>> values) { public Predicate in(Expression<Collection<?>> values) {
return queryBuilder().in( this, values ); return criteriaBuilder().in( this, values );
} }
/** /**

View File

@ -86,7 +86,7 @@ public class SearchedCaseExpression<R>
final Class<R> type = result != null final Class<R> type = result != null
? (Class<R>) result.getClass() ? (Class<R>) result.getClass()
: getJavaType(); : 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) { public Case<R> when(Expression<Boolean> condition, Expression<? extends R> result) {

View File

@ -94,7 +94,7 @@ public class SimpleCaseExpression<C,R>
final Class<R> type = result != null final Class<R> type = result != null
? (Class<R>) result.getClass() ? (Class<R>) result.getClass()
: getJavaType(); : 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) { public SimpleCase<C, R> when(C condition, Expression<? extends R> result) {

View File

@ -236,7 +236,7 @@ public abstract class AbstractFromImpl<Z,X>
final Class<Y> attributeType = attribute.getBindableJavaType(); final Class<Y> attributeType = attribute.getBindableJavaType();
return new SingularAttributeJoin<X,Y>( return new SingularAttributeJoin<X,Y>(
queryBuilder(), criteriaBuilder(),
attributeType, attributeType,
this, this,
attribute, attribute,
@ -272,7 +272,7 @@ public abstract class AbstractFromImpl<Z,X>
final Class<Y> attributeType = collection.getBindableJavaType(); final Class<Y> attributeType = collection.getBindableJavaType();
return new CollectionAttributeJoin<X, Y>( return new CollectionAttributeJoin<X, Y>(
queryBuilder(), criteriaBuilder(),
attributeType, attributeType,
this, this,
collection, 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 // TODO : runtime check that the attribute in fact belongs to this From's model/bindable
final Class<Y> attributeType = set.getBindableJavaType(); 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 // TODO : runtime check that the attribute in fact belongs to this From's model/bindable
final Class<Y> attributeType = list.getBindableJavaType(); 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 // TODO : runtime check that the attribute in fact belongs to this From's model/bindable
final Class<V> attributeType = map.getBindableJavaType(); 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 );
} }
/** /**

View File

@ -69,7 +69,7 @@ public abstract class AbstractPathImpl<X>
PathSource pathSource) { PathSource pathSource) {
super( criteriaBuilder, javaType ); super( criteriaBuilder, javaType );
this.pathSource = pathSource; this.pathSource = pathSource;
this.typeExpression = new PathTypeExpression( queryBuilder(), getJavaType() ); this.typeExpression = new PathTypeExpression( criteriaBuilder(), getJavaType() );
} }
public PathSource getPathSource() { public PathSource getPathSource() {
@ -137,7 +137,7 @@ public abstract class AbstractPathImpl<X>
SingularAttributePath<Y> path = (SingularAttributePath<Y>) resolveCachedAttributePath( attribute.getName() ); SingularAttributePath<Y> path = (SingularAttributePath<Y>) resolveCachedAttributePath( attribute.getName() );
if ( path == null ) { 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 ); registerAttributePath( attribute.getName(), path );
} }
return path; return path;
@ -154,7 +154,7 @@ public abstract class AbstractPathImpl<X>
PluralAttributePath<C> path = (PluralAttributePath<C>) resolveCachedAttributePath( attribute.getName() ); PluralAttributePath<C> path = (PluralAttributePath<C>) resolveCachedAttributePath( attribute.getName() );
if ( path == null ) { if ( path == null ) {
path = new PluralAttributePath<C>( queryBuilder(), this, attribute ); path = new PluralAttributePath<C>( criteriaBuilder(), this, attribute );
registerAttributePath( attribute.getName(), path ); registerAttributePath( attribute.getName(), path );
} }
return path; return path;
@ -171,7 +171,7 @@ public abstract class AbstractPathImpl<X>
PluralAttributePath path = (PluralAttributePath) resolveCachedAttributePath( attribute.getName() ); PluralAttributePath path = (PluralAttributePath) resolveCachedAttributePath( attribute.getName() );
if ( path == null ) { if ( path == null ) {
path = new PluralAttributePath( queryBuilder(), this, attribute ); path = new PluralAttributePath( criteriaBuilder(), this, attribute );
registerAttributePath( attribute.getName(), path ); registerAttributePath( attribute.getName(), path );
} }
return path; return path;

View File

@ -70,7 +70,7 @@ public class CollectionAttributeJoin<O,E>
@Override @Override
protected FromImplementor<O, E> createCorrelationDelegate() { protected FromImplementor<O, E> createCorrelationDelegate() {
return new CollectionAttributeJoin<O,E>( return new CollectionAttributeJoin<O,E>(
queryBuilder(), criteriaBuilder(),
getJavaType(), getJavaType(),
(PathImplementor<O>) getParentPath(), (PathImplementor<O>) getParentPath(),
getAttribute(), getAttribute(),

View File

@ -60,7 +60,7 @@ public class ListAttributeJoin<O,E>
* {@inheritDoc} * {@inheritDoc}
*/ */
public Expression<Integer> index() { public Expression<Integer> index() {
return new ListIndexExpression( queryBuilder(), this, getAttribute() ); return new ListIndexExpression( criteriaBuilder(), this, getAttribute() );
} }
@Override @Override
@ -81,7 +81,7 @@ public class ListAttributeJoin<O,E>
@Override @Override
protected FromImplementor<O, E> createCorrelationDelegate() { protected FromImplementor<O, E> createCorrelationDelegate() {
return new ListAttributeJoin<O,E>( return new ListAttributeJoin<O,E>(
queryBuilder(), criteriaBuilder(),
getJavaType(), getJavaType(),
(PathImplementor<O>) getParentPath(), (PathImplementor<O>) getParentPath(),
getAttribute(), getAttribute(),

View File

@ -75,7 +75,7 @@ public class MapAttributeJoin<O,K,V>
@Override @Override
protected FromImplementor<O, V> createCorrelationDelegate() { protected FromImplementor<O, V> createCorrelationDelegate() {
return new MapAttributeJoin<O,K,V>( return new MapAttributeJoin<O,K,V>(
queryBuilder(), criteriaBuilder(),
getJavaType(), getJavaType(),
(PathImplementor<O>) getParentPath(), (PathImplementor<O>) getParentPath(),
getAttribute(), getAttribute(),
@ -96,7 +96,7 @@ public class MapAttributeJoin<O,K,V>
*/ */
@SuppressWarnings({ "unchecked" }) @SuppressWarnings({ "unchecked" })
public Expression<Map.Entry<K, V>> entry() { 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" }) @SuppressWarnings({ "unchecked" })
public Path<K> key() { public Path<K> key() {
final MapKeyHelpers.MapKeySource<K,V> mapKeySource = new MapKeyHelpers.MapKeySource<K,V>( final MapKeyHelpers.MapKeySource<K,V> mapKeySource = new MapKeyHelpers.MapKeySource<K,V>(
queryBuilder(), criteriaBuilder(),
getAttribute().getJavaType(), getAttribute().getJavaType(),
this, this,
getAttribute() getAttribute()
); );
final MapKeyHelpers.MapKeyAttribute mapKeyAttribute = new MapKeyHelpers.MapKeyAttribute( queryBuilder(), getAttribute() ); final MapKeyHelpers.MapKeyAttribute mapKeyAttribute = new MapKeyHelpers.MapKeyAttribute( criteriaBuilder(), getAttribute() );
return new MapKeyHelpers.MapKeyPath( queryBuilder(), mapKeySource, mapKeyAttribute ); return new MapKeyHelpers.MapKeyPath( criteriaBuilder(), mapKeySource, mapKeyAttribute );
} }
} }

View File

@ -57,7 +57,7 @@ public class RootImpl<X> extends AbstractFromImpl<X,X> implements Root<X>, Seria
@Override @Override
protected FromImplementor<X, X> createCorrelationDelegate() { protected FromImplementor<X, X> createCorrelationDelegate() {
return new RootImpl<X>( queryBuilder(), getEntityType() ); return new RootImpl<X>( criteriaBuilder(), getEntityType() );
} }
@Override @Override

View File

@ -72,7 +72,7 @@ public class SetAttributeJoin<O,E>
@Override @Override
protected FromImplementor<O, E> createCorrelationDelegate() { protected FromImplementor<O, E> createCorrelationDelegate() {
return new SetAttributeJoin<O,E>( return new SetAttributeJoin<O,E>(
queryBuilder(), criteriaBuilder(),
getJavaType(), getJavaType(),
(PathImplementor<O>) getParentPath(), (PathImplementor<O>) getParentPath(),
getAttribute(), getAttribute(),

View File

@ -69,7 +69,7 @@ public class SingularAttributeJoin<Z,X> extends AbstractJoinImpl<Z,X> {
@Override @Override
protected FromImplementor<Z, X> createCorrelationDelegate() { protected FromImplementor<Z, X> createCorrelationDelegate() {
return new SingularAttributeJoin<Z,X>( return new SingularAttributeJoin<Z,X>(
queryBuilder(), criteriaBuilder(),
getJavaType(), getJavaType(),
getPathSource(), getPathSource(),
getAttribute(), getAttribute(),

View File

@ -143,7 +143,7 @@ public class InPredicate<T>
} }
public InPredicate<T> value(T value) { 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) { public InPredicate<T> value(Expression<? extends T> value) {