1 | /* |
---|
2 | * Copyright (C) 2013 DASISH |
---|
3 | * |
---|
4 | * This program is free software; you can redistribute it and/or |
---|
5 | * modify it under the terms of the GNU General Public License |
---|
6 | * as published by the Free Software Foundation; either version 2 |
---|
7 | * of the License, or (at your option) any later version. |
---|
8 | * |
---|
9 | * This program is distributed in the hope that it will be useful, |
---|
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
12 | * GNU General Public License for more details. |
---|
13 | * |
---|
14 | * You should have received a copy of the GNU General Public License |
---|
15 | * along with this program; if not, write to the Free Software |
---|
16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
---|
17 | */ |
---|
18 | package eu.dasish.annotation.backend.dao; |
---|
19 | |
---|
20 | import eu.dasish.annotation.backend.identifiers.VersionIdentifier; |
---|
21 | import eu.dasish.annotation.schema.CachedRepresentationInfo; |
---|
22 | import eu.dasish.annotation.schema.Version; |
---|
23 | import java.util.List; |
---|
24 | |
---|
25 | /** |
---|
26 | * |
---|
27 | * @author olhsha |
---|
28 | */ |
---|
29 | public interface VersionDao { |
---|
30 | |
---|
31 | /** |
---|
32 | * |
---|
33 | * @param internalID |
---|
34 | * @return extrnalID identifier of the resource with internalID |
---|
35 | */ |
---|
36 | |
---|
37 | public VersionIdentifier getExternalID(Number internalID); |
---|
38 | |
---|
39 | /** |
---|
40 | * |
---|
41 | * @param externalID |
---|
42 | * @return the internal Id of the Version with the external ID "externalID" |
---|
43 | */ |
---|
44 | public Number getInternalID(VersionIdentifier externalID); |
---|
45 | |
---|
46 | |
---|
47 | /** |
---|
48 | * |
---|
49 | * @param internalID |
---|
50 | * @return the instance of Version.class with the internal Id equal to "internalID" |
---|
51 | * |
---|
52 | */ |
---|
53 | public Version getVersion(Number internalID); |
---|
54 | |
---|
55 | |
---|
56 | |
---|
57 | /** @param versionID |
---|
58 | * @return |
---|
59 | * result[0] # deleted rows in the joit table "versions_cached_representations" |
---|
60 | * result[1] # deleted rows in "version" table |
---|
61 | */ |
---|
62 | |
---|
63 | public int[] deleteVersion(Number versionID); |
---|
64 | |
---|
65 | /** |
---|
66 | * |
---|
67 | * @param version |
---|
68 | * @return the internal Id of the just added version |
---|
69 | * |
---|
70 | */ |
---|
71 | public Number addVersion(Version version); |
---|
72 | |
---|
73 | |
---|
74 | /** |
---|
75 | * |
---|
76 | * @param versionID |
---|
77 | * @return The list of the cached representation internal id-s of all the cached representations of the version with "versionID" |
---|
78 | */ |
---|
79 | public List<Number> retrieveCachedRepresentationList(Number versionID); |
---|
80 | |
---|
81 | |
---|
82 | public int deleteVersionCachedRepresentation(Number versionID, Number cachedID); |
---|
83 | |
---|
84 | |
---|
85 | public int addVersionCachedRepresentation(Number versionID, Number cachedID); |
---|
86 | |
---|
87 | } |
---|
88 | |
---|
89 | |
---|