public interface DAO
A very neat abstraction for the common database operations I've been using for the past ~8 years or so.
Type Params | Return Type | Name and description |
---|---|---|
<T, K extends Serializable> |
public EntityCollection<T, K> |
collection(java.lang.Class<T> entityType, java.lang.Class<K> idType) Create an EntityCollection for a particular type. |
|
public SqlQuery |
createQuery(java.lang.String sql) Create a native SQL query. |
|
public SqlQuery |
createQuery(java.lang.String sql, java.lang.Object positionalParams) Create a native SQL query with positional parameters |
|
public SqlQuery |
createQuery(java.lang.String sql, java.util.Map<java.lang.String, java.lang.Object> namedParams)
|
Create an EntityCollection for a particular type.
entityType
- The annotatedidType
- The type of theT
- Class ot type TK
- Class of type K which extends SerializableCreate a native SQL query.
sql
- A native SQL query.Create a native SQL query with positional parameters
sql
- A native SQL statementpositionalParams
- Positional parameters
sql
- A native SQL query.namedParams
- a Map of named parameters.