mirror of
https://github.com/apache/openjpa.git
synced 2025-02-21 01:15:30 +00:00
OPENJPA-1202: Upgrade to Geronimo JPA 2.0 EA6
git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@798684 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
7c4cf09bca
commit
76e82998f6
@ -48,7 +48,7 @@ public class ParameterImpl<T> implements QueryParameter<T> {
|
||||
private final String _name;
|
||||
private final Integer _position;
|
||||
private final Class<?> _expectedValueType;
|
||||
private Object _value;
|
||||
private T _value;
|
||||
private boolean _bound;
|
||||
|
||||
/**
|
||||
@ -128,7 +128,7 @@ public class ParameterImpl<T> implements QueryParameter<T> {
|
||||
*
|
||||
* @exception if the given value is not permissible for this parameter.
|
||||
*/
|
||||
public QueryParameter<T> bindValue(Object v) {
|
||||
public QueryParameter<T> bindValue(T v) {
|
||||
if (!isValueAssignable(v)) {
|
||||
if (v == null)
|
||||
throw new IllegalArgumentException(_loc.get("param-null-not-assignable", this).getMessage());
|
||||
@ -201,4 +201,9 @@ public class ParameterImpl<T> implements QueryParameter<T> {
|
||||
|
||||
return buf.toString();
|
||||
}
|
||||
|
||||
public Class<T> getJavaType() {
|
||||
Class<?> cls = _value.getClass();
|
||||
return (Class<T>) cls;
|
||||
}
|
||||
}
|
||||
|
@ -518,7 +518,7 @@ public class PersistenceUnitInfoImpl
|
||||
}
|
||||
}
|
||||
|
||||
public String PersistenceXMLSchemaVersion() {
|
||||
public String getPersistenceXMLSchemaVersion() {
|
||||
return _schemaVersion;
|
||||
}
|
||||
|
||||
@ -549,7 +549,6 @@ public class PersistenceUnitInfoImpl
|
||||
}
|
||||
|
||||
public SharedCacheMode getSharedCacheMode() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
throw new UnsupportedOperationException("JPA 2.0 - Method not yet implemented");
|
||||
}
|
||||
}
|
||||
|
@ -90,6 +90,8 @@ public class QueryImpl<X> implements OpenJPAQuerySPI<X>, Serializable {
|
||||
private transient ReentrantLock _lock = null;
|
||||
private final HintHandler _hintHandler;
|
||||
|
||||
private Map<Parameter<?>, Object> parmatersToValues = new HashMap<Parameter<?>, Object>();
|
||||
|
||||
/**
|
||||
* Constructor; supply factory exception translator and delegate.
|
||||
*
|
||||
@ -421,7 +423,7 @@ public class QueryImpl<X> implements OpenJPAQuerySPI<X>, Serializable {
|
||||
position), null, null, false);
|
||||
|
||||
Class<?> valueType = (Class<?>)_query.getParameterTypes().get((Object)position);
|
||||
ParameterImpl<?> param = new ParameterImpl<Object>(position, valueType);
|
||||
ParameterImpl<Object> param = new ParameterImpl<Object>(position, valueType);
|
||||
registerParameter(param);
|
||||
param.bindValue(value);
|
||||
|
||||
@ -459,7 +461,7 @@ public class QueryImpl<X> implements OpenJPAQuerySPI<X>, Serializable {
|
||||
}
|
||||
|
||||
Class<?> valueType = (Class<?>)_query.getParameterTypes().get(name);
|
||||
ParameterImpl<?> param = new ParameterImpl<Object>(name, valueType);
|
||||
ParameterImpl<Object> param = new ParameterImpl<Object>(name, valueType);
|
||||
registerParameter(param);
|
||||
param.bindValue(value);
|
||||
|
||||
@ -925,4 +927,8 @@ public class QueryImpl<X> implements OpenJPAQuerySPI<X>, Serializable {
|
||||
return _query.getParameterTypes().keySet();
|
||||
}
|
||||
|
||||
public boolean isBound(Parameter<?> param) {
|
||||
return parmatersToValues.keySet().contains(param);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ public interface QueryParameter<T> extends Parameter<T> {
|
||||
/**
|
||||
* Binds the given value to this parameter.
|
||||
*/
|
||||
public abstract QueryParameter<T> bindValue(Object v);
|
||||
public abstract QueryParameter<T> bindValue(T v);
|
||||
|
||||
/**
|
||||
* Gets the value of this parameter without checking whether the any value has been
|
||||
|
@ -40,8 +40,8 @@ public class OrderImpl implements Order {
|
||||
this(e, true);
|
||||
}
|
||||
|
||||
public <T extends Comparable<T>> Expression<T> getExpression() {
|
||||
return (Expression<T>)e;
|
||||
public Expression<?> getExpression() {
|
||||
return e;
|
||||
}
|
||||
|
||||
public Expression getExpression5() {
|
||||
|
@ -101,7 +101,7 @@ public class ParameterExpressionImpl<T> extends ExpressionImpl<T>
|
||||
_delegate.clearBinding();
|
||||
}
|
||||
|
||||
public final QueryParameter<T> bindValue(Object v) {
|
||||
public final QueryParameter<T> bindValue(T v) {
|
||||
return _delegate.bindValue(v);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user