Package com.openmeet.shared.data.storage
Interface DAO<T>
- All Known Implementing Classes:
BanDAO,ImageDAO,InterestDAO,Meeter_InterestDAO,MeeterDAO,MessageDAO,RatingDAO,ReportDAO
public interface DAO<T>
It contains all the methods that should be implemented
by the DAOs.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionbooleanDeletes objects from the database that match a given condition.Returns a list of all objects from the database.doRetrieveAll(int row_count) Returns a list of objects from the database, limiting the result set to the specified number of rows.doRetrieveAll(int offset, int row_count) Returns a list of objects from the database, starting at a specified offset and limiting the result set to the specified number of rows.doRetrieveByCondition(String condition) Returns a list of objects from the database that match a given condition.doRetrieveByCondition(String condition, int row_count) Returns a list of objects from the database that match a given condition.doRetrieveByCondition(String condition, int offset, int row_count) Returns a list of objects from the database that match a given condition.doRetrieveByKey(String key) Returns an object from the database that match a given key.booleanSaves an object in the database populating only the fields contained in values.booleanSaves an object in the database.booleandoSaveOrUpdate(T obj) Saves an object to the database if it does not already exist, or updates it if it does.booleanUpdates database objects that match a given condition, using only the values contained in the HashMap
-
Field Details
-
DO_RETRIEVE_BY_CONDITION
- See Also:
-
DO_RETRIEVE_BY_CONDITION_LIMIT
- See Also:
-
DO_RETRIEVE_BY_CONDITION_LIMIT_OFFSET
- See Also:
-
DO_RETRIEVE_BY_KEY
- See Also:
-
DO_RETRIEVE_ALL
- See Also:
-
DO_RETRIEVE_ALL_LIMIT
- See Also:
-
DO_RETRIEVE_ALL_LIMIT_OFFSET
- See Also:
-
DO_SAVE
- See Also:
-
DO_SAVE_PARTIAL
- See Also:
-
DO_UPDATE
- See Also:
-
DO_SAVE_OR_UPDATE
- See Also:
-
DO_DELETE
- See Also:
-
logger
-
-
Method Details
-
doRetrieveByCondition
Returns a list of objects from the database that match a given condition.- Parameters:
condition- the condition to be matched.- Returns:
- the query results as a list of objects.
- Throws:
SQLException
-
doRetrieveByCondition
Returns a list of objects from the database that match a given condition.- Parameters:
condition- the condition to be matched.row_count- the number of rows to return.- Returns:
- the query results as a list of objects.
- Throws:
SQLException
-
doRetrieveByCondition
Returns a list of objects from the database that match a given condition.- Parameters:
condition- the condition to be matched.offset- the offset position.row_count- the number of rows to return.- Returns:
- the query results as a list of objects.
- Throws:
SQLException
-
doRetrieveByKey
Returns an object from the database that match a given key.- Parameters:
key- the primary key of the object to be retrieved.- Returns:
- the query result as a single object
- Throws:
SQLExceptionInvalidPrimaryKeyException
-
doRetrieveAll
Returns a list of all objects from the database.- Returns:
- the query results as a list of objects.
- Throws:
SQLException
-
doRetrieveAll
Returns a list of objects from the database, limiting the result set to the specified number of rows.- Parameters:
row_count- the number of rows to be returned.- Returns:
- the query results as a list of objects.
- Throws:
SQLException
-
doRetrieveAll
Returns a list of objects from the database, starting at a specified offset and limiting the result set to the specified number of rows.- Parameters:
offset- the offset to start the query from.row_count- the number of rows to be returned.- Returns:
- the query results as a list of objects.
- Throws:
SQLException
-
doSave
Saves an object in the database.- Parameters:
obj- the object to be saved.- Returns:
- a boolean value that indicates if the operation was successful or not.
- Throws:
SQLException
-
doSave
Saves an object in the database populating only the fields contained in values.- Parameters:
values- the values to be updated.- Returns:
- a boolean value that indicates if the operation was successful or not.
- Throws:
SQLException
-
doUpdate
Updates database objects that match a given condition, using only the values contained in the HashMap- Parameters:
values- the values to be updated.condition- the condition to be matched.- Returns:
- a boolean value that indicates if the operation was successful or not.
- Throws:
SQLException
-
doSaveOrUpdate
Saves an object to the database if it does not already exist, or updates it if it does.- Parameters:
obj- the object to be saved or updated.- Returns:
- a boolean value that indicates if the operation was successful or not.
- Throws:
SQLException
-
doDelete
Deletes objects from the database that match a given condition.- Parameters:
condition- the condition to be matched.- Returns:
- a boolean value that indicates if the operation was successful or not.
- Throws:
SQLException
-