remove deprecated constructor from TypedValue

This commit is contained in:
Nikolay Shestakov 2013-02-11 22:34:58 +06:00 committed by Strong Liu
parent 529a3e28ad
commit 6f2620b1c2
9 changed files with 12 additions and 19 deletions

View File

@ -1114,7 +1114,7 @@ public abstract class AbstractPersistentCollection implements Serializable, Pers
current,
session
);
currentIds.add( new TypedValue( idType, currentId, entityPersister.getEntityMode() ) );
currentIds.add( new TypedValue( idType, currentId ) );
}
}
}
@ -1123,7 +1123,7 @@ public abstract class AbstractPersistentCollection implements Serializable, Pers
for ( Object old : oldElements ) {
if ( !currentSaving.contains( old ) ) {
Serializable oldId = ForeignKeys.getEntityIdentifierIfNotUnsaved( entityName, old, session );
if ( !currentIds.contains( new TypedValue( idType, oldId, entityPersister.getEntityMode() ) ) ) {
if ( !currentIds.contains( new TypedValue( idType, oldId ) ) ) {
res.add( old );
}
}

View File

@ -287,7 +287,7 @@ public class Example implements Criterion {
if (isLikeEnabled) string = matchMode.toMatchString(string);
value = string;
}
list.add( new TypedValue(type, value, null) );
list.add( new TypedValue(type, value) );
}
}

View File

@ -86,13 +86,13 @@ public class InExpression implements Criterion {
Object subval = values[j]==null ?
null :
actype.getPropertyValues( values[j], EntityMode.POJO )[i];
list.add( new TypedValue( types[i], subval, EntityMode.POJO ) );
list.add( new TypedValue( types[i], subval ) );
}
}
}
else {
for ( int j=0; j<values.length; j++ ) {
list.add( new TypedValue( type, values[j], EntityMode.POJO ) );
list.add( new TypedValue( type, values[j] ) );
}
}
return (TypedValue[]) list.toArray( new TypedValue[ list.size() ] );

View File

@ -59,7 +59,7 @@ public class SQLCriterion implements Criterion {
this.sql = sql;
typedValues = new TypedValue[values.length];
for ( int i=0; i<typedValues.length; i++ ) {
typedValues[i] = new TypedValue( types[i], values[i], EntityMode.POJO );
typedValues[i] = new TypedValue( types[i], values[i] );
}
}

View File

@ -47,7 +47,7 @@ public class SimpleSubqueryExpression extends SubqueryExpression {
TypedValue[] superTv = super.getTypedValues(criteria, criteriaQuery);
TypedValue[] result = new TypedValue[superTv.length+1];
System.arraycopy(superTv, 0, result, 1, superTv.length);
result[0] = new TypedValue( getTypes()[0], value, EntityMode.POJO );
result[0] = new TypedValue( getTypes()[0], value );
return result;
}

View File

@ -77,7 +77,7 @@ public class SizeExpression implements Criterion {
public TypedValue[] getTypedValues(Criteria criteria, CriteriaQuery criteriaQuery)
throws HibernateException {
return new TypedValue[] {
new TypedValue( StandardBasicTypes.INTEGER, size, EntityMode.POJO )
new TypedValue( StandardBasicTypes.INTEGER, size )
};
}

View File

@ -116,7 +116,7 @@ public abstract class SubqueryExpression implements Criterion {
Object[] ppValues = params.getPositionalParameterValues();
TypedValue[] tv = new TypedValue[ppTypes.length];
for ( int i=0; i<ppTypes.length; i++ ) {
tv[i] = new TypedValue( ppTypes[i], ppValues[i], EntityMode.POJO );
tv[i] = new TypedValue( ppTypes[i], ppValues[i] );
}
return tv;
}

View File

@ -52,10 +52,6 @@ public final class TypedValue implements Serializable {
}
);
}
@Deprecated
public TypedValue(Type type, Object value, EntityMode entityMode) {
this(type, value);
}
public Object getValue() {
return value;

View File

@ -512,8 +512,7 @@ public class CriteriaQueryTranslator implements CriteriaQuery {
final Loadable loadable = ( Loadable ) getPropertyMapping( getEntityName( subcriteria ) );
return new TypedValue(
loadable.getIdentifierType(),
value,
EntityMode.POJO
value
);
}
@ -618,16 +617,14 @@ public class CriteriaQueryTranslator implements CriteriaQuery {
}
return new TypedValue(
type,
value,
EntityMode.POJO
value
);
}
}
// Otherwise, this is an ordinary value.
return new TypedValue(
getTypeUsingProjection( subcriteria, propertyName ),
value,
EntityMode.POJO
value
);
}