T
- A class derivated from ResourceRepresentation
public interface DaoAccess<T extends ResourceRepresentation<?>>
ResourceRepresentation
Modifier and Type | Method and Description |
---|---|
int |
deleteResource(T resource)
This method has to delete the specified resource
|
<ID> T |
findById(ID resourceId)
This method has to return the resource corresponding to the given ID.
|
java.util.List<T> |
queryForAll()
This method has to return all resources of the parameterized type defined by the interface
|
void |
updateOrCreate(T resource)
This method has to create a new resource or update it if already exists.
|
int |
updateResource(T resource)
This method has to update the specified resource
|
void updateOrCreate(T resource) throws java.sql.SQLException
resource
- The resource to create or updatejava.sql.SQLException
- if a sql error occurs.<ID> T findById(ID resourceId) throws java.sql.SQLException
ResourceRepresentation
id field typeresourceId
- The id of the resourcejava.sql.SQLException
- if a sql error occursjava.util.List<T> queryForAll() throws java.sql.SQLException
java.sql.SQLException
- if a sql error occursint deleteResource(T resource) throws java.sql.SQLException
resource
- The resource to deletejava.sql.SQLException
- if a sql error occursint updateResource(T resource) throws java.sql.SQLException
resource
- The resource to updatejava.sql.SQLException
- if a sql error occurs