blob: a96e336c0987dbb24af253402940bb88b08172fe (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
package ch.asynk;
import java.util.List;
public abstract class AbstractDAOOperations<TIdentity,
TObject extends AbstractModel<TIdentity>,
TMapper extends AbstractMapper<TObject, TIdentity>> extends AbstractDAO<TObject, TMapper>
{
public int insert(final TObject obj)
{
return execInt(m -> m.insert(obj), true);
}
public int update(final TObject obj)
{
return execInt(m -> m.update(obj), true);
}
public int save(final TObject obj)
{
return (obj.isUnsaved() ? insert(obj) : update(obj));
}
public int delete(final TObject obj)
{
return execInt(m -> m.delete(obj), true);
}
public int count()
{
return execInt(m -> m.count());
}
public List<TObject> select()
{
return execObjects(m -> m.select());
}
public TObject selectOne(final TIdentity id)
{
return execObject(m -> m.selectOne(id));
}
}
|