Class CassandraMethodMapper
java.lang.Object
org.synchronoss.cpo.cassandra.meta.CassandraMethodMapper
- All Implemented Interfaces:
Serializable,Cloneable
CassandraMethodMapper defines, for each Java type CPO binds to/from Cassandra, the
Row
getter used to read that type back from a query result. It also serves as the registry of known
driver-native Java types: org.synchronoss.cpo.cassandra.CassandraBoundStatementFactory's
setBindValues consults it to tell a raw datastore-typed literal (e.g. a dynamic
where-clause value) apart from a bean instance whose attribute value still needs to be extracted.
There is no corresponding registry of BoundStatement setter methods -- bind values are applied
via a single PreparedStatement.bind(Object...) call rather than per-attribute reflective
setter invocation.- Author:
- david berry
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic CassandraMethodMapEntry<?, ?> getDatasourceMethod(Class<?> clazz) Looks up the datasource method for the Clazzstatic MethodMapperGets the MethodMapperstatic <M> MethodloadGetter(int methodType, Class<M> methodClass, String getterName) Loads the GetterMethod for the Datasource class
-
Method Details
-
getDatasourceMethod
Looks up the datasource method for the Clazz- Parameters:
clazz- The clazz to lookup- Returns:
- The CassandraMethodMapEntry
- Throws:
CpoException- An error occurred
-
getMethodMapper
Gets the MethodMapper- Returns:
- A MethodMapper
-
loadGetter
public static <M> Method loadGetter(int methodType, Class<M> methodClass, String getterName) throws IllegalArgumentException Loads the GetterMethod for the Datasource class- Type Parameters:
M- The type of the CLazz- Parameters:
methodType- The type of method to loadmethodClass- The Clazz we are getting the method fromgetterName- the getter name- Returns:
- The Method
- Throws:
IllegalArgumentException- An invalid Method Type, or invalid getter name was provided
-