gvsig-projects-pool / org.gvsig.cvsgis / trunk / org.gvsig.cvsgis / org.gvsig.cvsgis.lib / org.gvsig.cvsgis.lib.impl / src / main / java / org / gvsig / cvsgis / impl / localdb / RepoEntityImpl.java @ 2324
History | View | Annotate | Download (3.05 KB)
1 |
/*
|
---|---|
2 |
* gvSIG. Desktop Geographic Information System.
|
3 |
*
|
4 |
* Copyright (C) 2007-2020 gvSIG Association.
|
5 |
*
|
6 |
* This program is free software; you can redistribute it and/or
|
7 |
* modify it under the terms of the GNU General Public License
|
8 |
* as published by the Free Software Foundation; either version 3
|
9 |
* of the License, or (at your option) any later version.
|
10 |
*
|
11 |
* This program is distributed in the hope that it will be useful,
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14 |
* GNU General Public License for more details.
|
15 |
*
|
16 |
* You should have received a copy of the GNU General Public License
|
17 |
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
18 |
*
|
19 |
* For any additional information, do not hesitate to contact us
|
20 |
* at info AT gvsig.com, or visit our website www.gvsig.com.
|
21 |
*/
|
22 |
|
23 |
package org.gvsig.cvsgis.impl.localdb; |
24 |
|
25 |
import org.gvsig.cvsgis.impl.localdb.tables.BranchsTable; |
26 |
import org.gvsig.cvsgis.impl.localdb.tables.EntitiesTable; |
27 |
import org.gvsig.cvsgis.lib.CvsGisRepository; |
28 |
|
29 |
/**
|
30 |
*
|
31 |
* @author gvSIG Team
|
32 |
*/
|
33 |
class RepoEntityImpl implements CvsGisRepository.RepoEntity { |
34 |
|
35 |
private final EntitiesTable.EntityRow entity; |
36 |
private BranchsTable.BranchRow branch;
|
37 |
|
38 |
public RepoEntityImpl(EntitiesTable.EntityRow entity, BranchsTable.BranchRow branch) {
|
39 |
this.entity = entity;
|
40 |
this.branch = branch;
|
41 |
} |
42 |
|
43 |
public RepoEntityImpl(EntitiesTable.EntityRow entity) {
|
44 |
this(entity,null); |
45 |
} |
46 |
|
47 |
private BranchsTable.BranchRow getBranch() {
|
48 |
if( this.branch == null ) { |
49 |
this.branch = this.entity.getDefaultBranch(); |
50 |
} |
51 |
return this.branch; |
52 |
} |
53 |
|
54 |
@Override
|
55 |
public String getCode() { |
56 |
return this.entity.getCode(); |
57 |
} |
58 |
|
59 |
@Override
|
60 |
public String getUserCode() { |
61 |
return this.entity.getUserCode(); |
62 |
} |
63 |
|
64 |
@Override
|
65 |
public String getTopologyPlanCode() { |
66 |
return this.entity.getTopologyPlanCode(); |
67 |
} |
68 |
|
69 |
@Override
|
70 |
public String getEntityName() { |
71 |
return this.entity.getEntityName(); |
72 |
} |
73 |
|
74 |
@Override
|
75 |
public String getDataTableName() { |
76 |
return this.entity.getDataTableName(); |
77 |
} |
78 |
|
79 |
@Override
|
80 |
public String getGeometryFieldName() { |
81 |
return this.entity.getGeometryFieldName(); |
82 |
} |
83 |
|
84 |
@Override
|
85 |
public String getFeatureIdFieldName() { |
86 |
return this.entity.getFeatureIdFieldName(); |
87 |
} |
88 |
|
89 |
@Override
|
90 |
public String getDescription() { |
91 |
return this.entity.getDescription(); |
92 |
} |
93 |
|
94 |
@Override
|
95 |
public String getDefaultBranchName() { |
96 |
return this.getBranch().getBranchName(); |
97 |
} |
98 |
|
99 |
@Override
|
100 |
public String getLastRevisionCode() { |
101 |
return this.getBranch().getRevisionCode(); |
102 |
} |
103 |
|
104 |
@Override
|
105 |
public String getBranchCode() { |
106 |
return this.getBranch().getCode(); |
107 |
} |
108 |
|
109 |
@Override
|
110 |
public String getBranchName() { |
111 |
return this.getBranch().getBranchName(); |
112 |
} |
113 |
|
114 |
@Override
|
115 |
public String getFeatureTypeAsJson() { |
116 |
return this.entity.getFeatureTypeAsJson(); |
117 |
} |
118 |
|
119 |
} |