Class GAEJPADataSource

All Implemented Interfaces:
com.isomorphic.base.IAutoConfigurable, com.isomorphic.datasource.Committable, com.isomorphic.datasource.FreeResourcesHandler, com.isomorphic.datasource.IType, IToJSON, Serializable

public class GAEJPADataSource extends JPADataSource
Server side implementation of JPA 1.0 data source under Google Application Engine.

There are four main differences:

  • GAE supports queries with LIKE clause only with single wildcard at the end thus TextMatchStyle.SUBSTRING works exactly as TextMatchStyle.STARTS_WITH
  • GAE does not support upper()/lower(). Search queries are always case sensitive.
  • Exact match is used when comparing number fields.
  • GAE does not support FetchType.EAGER. Every method should initialize lazily loaded properties of every entity loaded from data source.
This class implements only simple search criteria.

Implementation is not thread-safe. Data source acquiring mechanism ensures that single instance of this class will be used in one thread only.

See Also:
  • Field Details

    • GAE_VERSION_PROPERTY

      public static final String GAE_VERSION_PROPERTY
      Holds name of the system property to identity Google Application Engine runtime version.
      See Also:
    • GAE_RUNTIME_PROPERTY

      public static final String GAE_RUNTIME_PROPERTY
      Holds name of the system property to identity Google Application Engine runtime environment. Possible values are:
      • Production when running on App Engine
      • Development when running in the development server
      See Also:
    • BIGTABLE_ACTIVE

      public static final boolean BIGTABLE_ACTIVE
      Holds true if running under Google Application Engine BigTable; false if running under relational database.
  • Method Details

    • deriveDS

      public Map<String,Object> deriveDS(String schemaBean, String id, boolean extended)
      Creates data source configuration from specified fully qualified class name.
      Overrides:
      deriveDS in class JPADataSource
      Parameters:
      schemaBean - String Fully qualified class name.
      id - String Id for newly created data source.
      extended - boolean Extended properties will be captured if set to true.
      Returns:
      Map<String, Object> created data source configuration or null if it can not be created.
    • executeFetch

      public DSResponse executeFetch(DSRequest req) throws Exception
      This method is called by DataSource.execute() for "fetch" operations. It is the appropriate override point if you wish to provide custom handling of a "fetch".
      Overrides:
      executeFetch in class JPADataSource
      Parameters:
      req - The DSRequest object representing this operation
      Returns:
      A valid DSResponse
      Throws:
      Exception - if an error occurs during the fetch operation
    • executeAdd

      public DSResponse executeAdd(DSRequest req) throws Exception
      This method is called by DataSource.execute() for "add" operations. It is the appropriate override point if you wish to provide custom handling of an "add".
      Overrides:
      executeAdd in class JPADataSource
      Parameters:
      req - The DSRequest object representing this operation
      Returns:
      A valid DSResponse
      Throws:
      Exception - if an error occurs during the add operation
    • executeUpdate

      public DSResponse executeUpdate(DSRequest req) throws Exception
      This method is called by DataSource.execute() for "update" operations. It is the appropriate override point if you wish to provide custom handling of an "update".
      Overrides:
      executeUpdate in class JPADataSource
      Parameters:
      req - The DSRequest object representing this operation
      Returns:
      A valid DSResponse
      Throws:
      Exception - if an error occurs during the update operation