Package com.isomorphic.jpa
Class GAEJPADataSource
java.lang.Object
com.isomorphic.base.Base
com.isomorphic.datasource.DataSource
com.isomorphic.datasource.BasicDataSource
com.isomorphic.jpa.JPADataSource
com.isomorphic.jpa.GAEJPADataSource
- All Implemented Interfaces:
com.isomorphic.base.IAutoConfigurable
,com.isomorphic.datasource.Committable
,com.isomorphic.datasource.FreeResourcesHandler
,com.isomorphic.datasource.IType
,IToJSON
,Serializable
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 thusTextMatchStyle.SUBSTRING
works exactly asTextMatchStyle.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.
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final boolean
Holdstrue
if running under Google Application Engine BigTable;false
if running under relational database.static final String
Holds name of the system property to identity Google Application Engine runtime environment.static final String
Holds name of the system property to identity Google Application Engine runtime version.Fields inherited from class com.isomorphic.jpa.JPADataSource
additionalFields, AUTO_DERIVE_PROPERTY, BEAN_CLASS_PROPERTY, beanClass, beanName, configName, connectionHolder, em, ESCAPE_CHARACTER, generateRelatedUpdates, ID_CLASS_PROPERTY, idClass, JPA_CONFIG_PROPERTY, relatedUpdates, SCHEMA_BEAN_PROPERTY, shouldRollBackTransaction, strictSQLFiltering, tx, USE_QUALIFIED_CLASS_NAME_PROPERTY, useQualifiedClassName
Fields inherited from class com.isomorphic.datasource.DataSource
OP_ADD, OP_CLIENT_EXPORT, OP_CUSTOM, OP_DOWNLOAD_FILE, OP_FETCH, OP_GET_FILE, OP_GET_FILE_VERSION, OP_HAS_FILE, OP_HAS_FILE_VERSION, OP_LIST_FILE_VERSIONS, OP_LIST_FILES, OP_LOAD_SCHEMA, OP_REMOVE, OP_REMOVE_FILE, OP_REMOVE_FILE_VERSION, OP_RENAME_FILE, OP_SAVE_FILE, OP_UNIQUE_NAME, OP_UPDATE, OP_VALIDATE, OP_VIEW_FILE
-
Method Summary
Modifier and TypeMethodDescriptionCreates data source configuration from specified fully qualified class name.executeAdd
(DSRequest req) This method is called by DataSource.execute() for "add" operations.executeFetch
(DSRequest req) This method is called by DataSource.execute() for "fetch" operations.executeUpdate
(DSRequest req) This method is called by DataSource.execute() for "update" operations.Methods inherited from class com.isomorphic.jpa.JPADataSource
escapeValueForFilter, execute, executeRemove, freeResources, getField, getFieldNames, getTransactionObjectKey, increaseOpCount, init, markTransactionForRollBack
Methods inherited from class com.isomorphic.datasource.BasicDataSource
getAuditDataSource, getAuditRecord, getAuditRecord, hasCustomDefaultFetchOperation, hasCustomLogic, shouldAutoJoinTransaction, shouldAutoStartTransaction, transformMultipleFields, transformMultipleFields, writeMultiAudits
Methods inherited from class com.isomorphic.datasource.DataSource
add, add, addDynamicDSGenerator, addDynamicDSGenerator, addDynamicDSGenerator, clearDynamicDSGenerators, convertRelativeDates, convertRelativeDates, convertRelativeDates, convertRelativeDates, convertRelativeDates, convertRelativeDates, executeFileSource, fetch, fetch, fetchById, fetchById, fetchById, fetchSingle, fetchSingle, filter, filter, fromXML, fromXML, fromXML, fromXML, fromXML, fromXML, fromXML, fromXML, get1ManyRelationFields, getAuditChangedFieldsFieldName, getAuditRevisionFieldName, getAuditTimestampFieldName, getAuditTypeFieldName, getAuditUserFieldName, getDefaultDynamicDSGenerator, getDirectFields, getDynamicDSGenerators, getEnumConstantProperty, getEnumOrdinalProperty, getEnumTranslateStrategy, getFieldNames, getFile, getFileAsInputStream, getFileAsString, getFileContentsField, getFileFormatField, getFileNameField, getFileTypeField, getID, getJoinDSName, getJoinDSName, getListProperties, getListProperties, getListProperty, getManyManyRelationFields, getMapProperty, getName, getNonIncludedFields, getObjectProperty, getOperationProperty, getPrimaryKey, getProperties, getProperties, getProperties, getProperty, getPropertyJavaClass, getRecordXPath, getRelatedDisplayRecord, getRelatedDisplayRecord, getRelatedDSName, getRelatedDSName, getRelatedTableAlias, getRelationFields, getTableName, getTransactionObject, getTransactionObject, has1ManyRelationFields, hasFile, hasManyManyRelationFields, hasRecord, hasRecord, hasRelationFields, initialized, is1ManyRelationField, isManyManyRelationField, isModificationOperation, isRelationField, isServerOnly, listFiles, listFiles, listFiles, listFiles, listFiles, listFiles, remove, removeDynamicDSGenerator, removeDynamicDSGenerator, removeDynamicDSGenerator, removeFile, renameFile, saveFile, setEnumConstantProperty, setEnumOrdinalProperty, setEnumTranslateStrategy, setOmitNullMapValuesInResponse, setProperties, transformImportValue, transformImportValue, transformResponse, update, update, validate, validate, validate, validateRecord
-
Field Details
-
GAE_VERSION_PROPERTY
Holds name of the system property to identity Google Application Engine runtime version.- See Also:
-
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_ACTIVEHoldstrue
if running under Google Application Engine BigTable;false
if running under relational database.
-
-
Method Details
-
deriveDS
Creates data source configuration from specified fully qualified class name.- Overrides:
deriveDS
in classJPADataSource
- Parameters:
schemaBean
-String
Fully qualified class name.id
-String
Id for newly created data source.extended
-boolean
Extended properties will be captured if set totrue
.- Returns:
Map<String, Object>
created data source configuration ornull
if it can not be created.
-
executeFetch
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 classJPADataSource
- Parameters:
req
- The DSRequest object representing this operation- Returns:
- A valid DSResponse
- Throws:
Exception
- if an error occurs during the fetch operation
-
executeAdd
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 classJPADataSource
- Parameters:
req
- The DSRequest object representing this operation- Returns:
- A valid DSResponse
- Throws:
Exception
- if an error occurs during the add operation
-
executeUpdate
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 classJPADataSource
- Parameters:
req
- The DSRequest object representing this operation- Returns:
- A valid DSResponse
- Throws:
Exception
- if an error occurs during the update operation
-