File tree Expand file tree Collapse file tree
driver-mapping/src/main/java/com/datastax/driver/mapping Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66- [ improvement] JAVA-1203: Upgrade Metrics to allow usage in OSGi.
77- [ bug] JAVA-1407: KeyspaceMetadata exportAsString should export user types in topological sort order.
88- [ bug] JAVA-1455: Mapper support using unset for null values.
9+ - [ bug] JAVA-1464: Allow custom codecs with non public constructors in @Param .
910
1011
1112### 3.2.0
Original file line number Diff line number Diff line change 1616package com .datastax .driver .mapping ;
1717
1818import com .datastax .driver .core .*;
19+ import com .datastax .driver .mapping .annotations .Defaults ;
1920import com .google .common .collect .Sets ;
2021import com .google .common .reflect .TypeToken ;
2122import com .google .common .util .concurrent .Futures ;
@@ -186,14 +187,7 @@ static class ParamMapper {
186187 this .paramName = paramName ;
187188 this .paramIdx = paramIdx ;
188189 this .paramType = (TypeToken <Object >) paramType ;
189- try {
190- this .codec = (codecClass == null ) ? null : (TypeCodec <Object >) codecClass .newInstance ();
191- } catch (Exception e ) {
192- throw new IllegalArgumentException (String .format (
193- "Cannot create instance of codec %s for parameter %s" ,
194- codecClass , (paramName == null ) ? paramIdx : paramName
195- ), e );
196- }
190+ this .codec = codecClass == null || codecClass .equals (Defaults .NoCodec .class ) ? null : (TypeCodec <Object >) ReflectionUtils .newInstance (codecClass );
197191 }
198192
199193 void setValue (BoundStatement boundStatement , Object arg ) {
You can’t perform that action at this time.
0 commit comments