Interface CpoMetaAdapter

All Known Implementing Classes:
AbstractCpoMetaAdapter, CpoMetaDescriptor

public interface CpoMetaAdapter
CpoMetaAdapter is the datastore-agnostic view over a loaded CPO metadata source: it resolves the CpoClass for a given bean, exposes the classes it knows about, and bridges between the datastore's native data type names/ids and their Java equivalents via the implementation's DataTypeMapper.
Author:
dberry
  • Method Details

    • getMetaClass

      <T> CpoClass getMetaClass(T bean) throws CpoException
      Returns the metadata for the class that is contained within the metadata source
      Type Parameters:
      T - The bean Type
      Parameters:
      bean - The java bean whose metaclass is needed
      Returns:
      the CpoClass metadata for bean's class
      Throws:
      CpoException - Thrown if there are errors accessing the datasource
    • getCpoClasses

      List<CpoClass> getCpoClasses() throws CpoException
      Returns a list of the cpo class objects that the meta adapter is aware of.
      Returns:
      java.util.List of CpoClass
      Throws:
      CpoException - Thrown if there are errors accessing the datasource
    • getExpressionParser

      ExpressionParser getExpressionParser() throws CpoException
      Gets the parser used to extract bind-marker/column information from this metadata source's native function expressions.
      Returns:
      the expression parser for this meta adapter
      Throws:
      CpoException - if the parser cannot be created
    • getDataTypeName

      String getDataTypeName(CpoAttribute attribute) throws CpoException
      Gets the Java class name that the given attribute's native data type maps to.
      Parameters:
      attribute - the attribute whose data type is being resolved
      Returns:
      the fully-qualified Java class name (array types are reported as byte[] or char[])
      Throws:
      CpoException - if the data type cannot be resolved
    • getDataTypeJavaClass

      Class<?> getDataTypeJavaClass(CpoAttribute attribute) throws CpoException
      Gets the Java class that the given attribute's native data type maps to.
      Parameters:
      attribute - the attribute whose data type is being resolved
      Returns:
      the Java class the attribute's value is represented as
      Throws:
      CpoException - if the data type cannot be resolved
    • getDataTypeInt

      int getDataTypeInt(String dataTypeName) throws CpoException
      Gets the integer identifier for a named native data type.
      Parameters:
      dataTypeName - the native data type name
      Returns:
      the integer identifier registered for dataTypeName
      Throws:
      CpoException - if the data type name is not recognized
    • getDataTypeMapEntry

      DataTypeMapEntry<?> getDataTypeMapEntry(int dataTypeInt) throws CpoException
      Gets the full data type mapping entry for a given native data type identifier.
      Parameters:
      dataTypeInt - the integer identifier of the native data type
      Returns:
      the DataTypeMapEntry registered for dataTypeInt
      Throws:
      CpoException - if the data type identifier is not recognized
    • getAllowableDataTypes

      List<String> getAllowableDataTypes() throws CpoException
      Gets the names of all native data types this meta adapter knows how to map.
      Returns:
      the list of allowable native data type names
      Throws:
      CpoException - if the data types cannot be retrieved