Package sonia.scm
Interface GenericDAO<T>
- Type Parameters:
T
- type of object
- All Superinterfaces:
CreationTimeAware
,LastModifiedAware
,TypedObject
- All Known Subinterfaces:
GroupDAO
,RepositoryDAO
,RepositoryRoleDAO
,UserDAO
Generic data access object. A DAO does not check the permission of the
current user. A DAO should only be used by a
Manager
class.- Since:
- 1.14
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Persists a new item.boolean
Returns true if the item with the specified id already exists in the backend.boolean
Returns true if the item already exists in the backend.void
Removes the specified item from the backend.Returns the item by its id or returns null if no item with the specified id exists in the backend.getAll()
Returns all items stored in the backend.void
Updates an existing item.Methods inherited from interface sonia.scm.CreationTimeAware
getCreationTime
Methods inherited from interface sonia.scm.LastModifiedAware
getLastModified
Methods inherited from interface sonia.scm.TypedObject
getType
-
Method Details
-
add
Persists a new item.- Parameters:
item
- item to persist
-
contains
Returns true if the item already exists in the backend.- Parameters:
item
- item to check
-
contains
Returns true if the item with the specified id already exists in the backend.- Parameters:
id
- id of the item to check
-
modify
Updates an existing item.- Parameters:
item
- item to update
-
delete
Removes the specified item from the backend.- Parameters:
item
- item to remove
-
get
Returns the item by its id or returns null if no item with the specified id exists in the backend. -
getAll
Collection<T> getAll()Returns all items stored in the backend.
-