blob: 854811a128197a7070f8c9f996c54d3a9c91ca75 (
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
45
46
47
48
49
|
package ch.asynk;
import java.util.List;
public abstract class AbstractDAOOperations<TIdentity,
TObject extends AbstractModel<TIdentity, TObject>,
TMapper extends AbstractMapper<TIdentity, TObject>> 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));
}
public TObject selectSelf(final TObject obj)
{
return execObject(m -> m.selectSelf(obj));
}
}
|