kikocis/java-driver public
Changesets · Branches · Tags · Compare
| Changeset | 62fd71450110dbf031db27f4c49e0bfb920a2f1f30d69c9990ee5c9ffd769cea |
|---|---|
| Author | Eric LELEU <eric.leleu@atos.net> · 2014-12-08 10:27 +01:00 |
| Committer | olim7t <omichallat+github@gmail.com> · 2015-03-04 19:28 -08:00 |
| Parents | 8dbbb33ac272 |
2 files changed
modified driver-core/CHANGELOG.rst +2 −0
| @@ -4,6 +4,8 @@ | ||
| 4 | 4 | 2.1.5: |
| 5 | 5 | ------ |
| 6 | 6 | |
| 7 | +- [bug] Authorize Null parameter in Accessor method (JAVA-575) | |
| 8 | + | |
| 7 | 9 | Merged from 2.0 branch: |
| 8 | 10 | |
| 9 | 11 | - [new feature] Add AddressTranslater for EC2 multi-region deployment (JAVA-518) |
modified driver-mapping/src/main/java/com/datastax/driver/mapping/MethodMapper.java +8 −3
| @@ -95,7 +95,7 @@ | ||
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | @SuppressWarnings("rawtypes") |
| 98 | - private void mapType(MappingManager manager, Class<?> fullReturnType, Type type) { | |
| 98 | + private void mapType(MappingManager manager, Class<?> fullReturnType, Type type) { | |
| 99 | 99 | |
| 100 | 100 | if (type instanceof ParameterizedType) { |
| 101 | 101 | ParameterizedType pt = (ParameterizedType)type; |
| @@ -167,9 +167,14 @@ | ||
| 167 | 167 | } |
| 168 | 168 | |
| 169 | 169 | void setValue(BoundStatement boundStatement, Object arg, ProtocolVersion protocolVersion) { |
| 170 | - if (arg != null) { | |
| 171 | - if (paramName == null) | |
| 170 | + if (paramName == null) { | |
| 171 | + if (arg == null) | |
| 172 | + boundStatement.setToNull(paramIdx); | |
| 173 | + else | |
| 172 | 174 | boundStatement.setBytesUnsafe(paramIdx, DataType.serializeValue(arg, protocolVersion)); |
| 175 | + } else { | |
| 176 | + if (arg == null) | |
| 177 | + boundStatement.setToNull(paramName); | |
| 173 | 178 | else |
| 174 | 179 | boundStatement.setBytesUnsafe(paramName, DataType.serializeValue(arg, protocolVersion)); |
| 175 | 180 | } |