Package com.newstep.solid.persistence
Batch update/create CRUDKeeper.
Author:
msimonsen
Links:
Generalization Generalization Link
Batch update/create CRUDKeeper.
Author:
msimonsen
| Template Signature Summary |
Abstract.
Throws:
PersistenceException
Batch update/create CRUDKeeper.
Author:
msimonsen
| Template Parameter Summary |
Parameter Metaclass:
Class20
Final.
Custom properties
templateParameterString:
T
Abstract.
Throws:
PersistenceException
A templated Create/Retrieve/Update/Delete Keeper, with
querying capabilities.
Consider making the ID an object or String, that allows
greater flexibility for the persistence mechanism.
Version:
1.0
Author:
msimonsen
Custom properties
param:
| Operation Summary |
| get | Get an object by its id. |
| query | Will perform filtering internally based on the Post query criteria. |
| query | Will build the appropriate external query so that the underlying persistence mechanism provides the filtering. |
| queryByBean | Builds an "AND"ed query based on the sample bean object egObject. |
| queryEntityByBean | Builds an "AND"ed query based on the sample bean object egObject to query a single instance that respects all the conditions. If none found, ObjectNotFoundException is thrown. The function is built to be used by retrieveByName. |
| Template Signature Summary |
Add an object.
Parameters:
obj
context
Return:
The keeper
Abstract.
Throws:
PersistenceException
Delete an object
Parameters:
obj
context
Abstract.
Throws:
PersistenceException
Get an object by its id.
Parameters:
id
context
Abstract.
Throws:
PersistenceException
Custom properties
return The:
keeper
Gets all records.
Parameters:
context
Return:
A collection of all objects
Abstract.
Throws:
PersistenceException
Abstract.
Will perform filtering internally based on the Post query criteria.
Parameters:
query - An initiated/populated postQuery criteria
context - Persistence context
Return:
A collection based on query.
Abstract.
Throws:
PersistenceException
Will build the appropriate external query so that the underlying
persistence mechanism provides the filtering.
Parameters:
query - An initiated/populated query
context - The persistence context.
Abstract.
Throws:
PersistenceException
Custom properties
return A:
collection based on query.
Builds an "AND"ed query based on the sample bean object egObject.
Parameters:
bean - the object to filter against
context
Return:
A collection based on query.
Abstract.
Throws:
PersistenceException
Builds an "AND"ed query based on the sample bean object egObject to query
a single instance that respects all the conditions. If none found,
ObjectNotFoundException is thrown. The function is built to be used by
retrieveByName.
Parameters:
bean - the object to filter against
context
Return:
A collection based on query.
Abstract.
Throws:
PersistenceException
| Template Parameter Summary |
Parameter Metaclass:
Class20
Final.
Custom properties
templateParameterString:
T
Update an object
Parameters:
obj
context
Abstract.
Throws:
PersistenceException
A filtering criteria that is executed once results are returned
from a query that retrieves all results.
This could be potentially expensive query
if the Keeper returns a large number of records.
Version:
1.0
Author:
msimonsen
| Operation Summary |
| matches | Performs post query evaluation to determine the a filtered collection being returned. |
Performs post query evaluation to determine the
a filtered collection being returned.
Parameters:
bean
Return:
true if a match is found
Abstract.
A query that builds a interpretable syntax for
allowing the underlying persistence mechanism
DB/LDAP/FILE(unlikely) filtering before results are
returned to the persistence application.
Author:
msimonsen
Returns an appropriate query OR clause.
Return:
A String that represents a parsable statement that
the persistence mechanism can use to query.
Abstract.
Abstraction of the transaction concept allowing console to operate using
multiple persistence mechanisms/vendors
| Operation Summary |
| begin | Starts the transaction |
| commit | commits the updates performed within the transaction Note: must be called after begin() and prior to end() |
| end | Ends the transaction Note: transaction should be commited or rolledback prior to calling end |
| rollback | Rolls back the persistence state prior to the transaction begin() Note: must be called after begin() and before end() |
Starts the transaction
Exceptions:
PersistenceException if an error occurs starting the transaction
Abstract.
Throws:
PersistenceException
commits the updates performed within the transaction
Note: must be called after begin() and prior to end()
Exceptions:
PersistenceException if an error occurs commiting the transaction
Abstract.
Throws:
PersistenceException
Final.
Multiplicity:
1
Static.
Ends the transaction
Note: transaction should be commited or rolledback prior to calling end
Exceptions:
PersistenceException if an error occurs ending the transaction
Abstract.
Throws:
PersistenceException
Final.
Multiplicity:
1
Static.
Final.
Multiplicity:
1
Static.
Final.
Multiplicity:
1
Static.
Rolls back the persistence state prior to the transaction begin()
Note: must be called after begin() and before end()
Exceptions:
PersistenceException if an error occurs performing the transaction rollback
Abstract.
Throws:
PersistenceException
Final.
Multiplicity:
1
Static.
A generic interface abstracting the various persistence mechanisms
for generating unique keys. This abstraction allows migration to
different persistence mechanisms/vendors though interface implementations
| Operation Summary |
| getNextUniqueId | Generates the next valid unique id for the specified sequence |
Gets the current UID for the specified sequence
Parameters:
uidName the name of the sequence
transaction the transaction in which the id retrieval should participate
Exceptions:
PersistenceException Description of the Exception
Return:
The currentUID value
Abstract.
Throws:
PersistenceException
Generates the next valid unique id for the specified sequence
Parameters:
uidName the name of the sequence
transaction the transaction in which the id generation should participate
Exceptions:
PersistenceException if an error occurs generating the next UID
Return:
The next UID value
Abstract.
Throws:
PersistenceException
Final.
Multiplicity:
1
Static.