mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-03-01 15:29:11 +00:00
Support for type coercion for values passed as ids and as query parameter bindings
- fixed compilation errors when using JDK 8
This commit is contained in:
parent
fa8571c706
commit
c87a50ca0f
@ -121,19 +121,19 @@ public <X> BigInteger coerce(X value, CoercionContext coercionContext) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ( value instanceof Byte ) {
|
if ( value instanceof Byte ) {
|
||||||
return BigInteger.valueOf( ( (byte) value ) );
|
return BigInteger.valueOf( ( (Byte) value ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( value instanceof Short ) {
|
if ( value instanceof Short ) {
|
||||||
return BigInteger.valueOf( ( (short) value ) );
|
return BigInteger.valueOf( ( (Short) value ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( value instanceof Integer ) {
|
if ( value instanceof Integer ) {
|
||||||
return BigInteger.valueOf( ( (int) value ) );
|
return BigInteger.valueOf( ( (Integer) value ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( value instanceof Long ) {
|
if ( value instanceof Long ) {
|
||||||
return BigInteger.valueOf( ( (long) value ) );
|
return BigInteger.valueOf( ( (Long) value ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( value instanceof Double ) {
|
if ( value instanceof Double ) {
|
||||||
|
@ -114,11 +114,11 @@ public <X> Byte coerce(X value, CoercionContext coercionContext) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ( value instanceof Byte ) {
|
if ( value instanceof Byte ) {
|
||||||
return (byte) value;
|
return (Byte) value;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( value instanceof Short ) {
|
if ( value instanceof Short ) {
|
||||||
return CoercionHelper.toByte( (short) value );
|
return CoercionHelper.toByte( (Short) value );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( value instanceof Integer ) {
|
if ( value instanceof Integer ) {
|
||||||
|
@ -149,7 +149,7 @@ public <X> Double coerce(X value, CoercionContext coercionContext) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ( value instanceof Float ) {
|
if ( value instanceof Float ) {
|
||||||
return CoercionHelper.toDouble( (float) value );
|
return CoercionHelper.toDouble( (Float) value );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( value instanceof BigInteger ) {
|
if ( value instanceof BigInteger ) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user