Class CassandraMethodMapper

java.lang.Object
org.synchronoss.cpo.cassandra.meta.CassandraMethodMapper
All Implemented Interfaces:
Serializable, Cloneable

public class CassandraMethodMapper extends Object implements 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 Details

    • getDatasourceMethod

      public static CassandraMethodMapEntry<?,?> getDatasourceMethod(Class<?> clazz) throws CpoException
      Looks up the datasource method for the Clazz
      Parameters:
      clazz - The clazz to lookup
      Returns:
      The CassandraMethodMapEntry
      Throws:
      CpoException - An error occurred
    • getMethodMapper

      public static MethodMapper 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 load
      methodClass - The Clazz we are getting the method from
      getterName - the getter name
      Returns:
      The Method
      Throws:
      IllegalArgumentException - An invalid Method Type, or invalid getter name was provided