source: mauRepo/CedaMolesModel/trunk/ceda_moles_model/ea_model/informative/iso_gdf/gdf_feature/gdf_areafeature.py @ 8437

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/mauRepo/CedaMolesModel/trunk/ceda_moles_model/ea_model/informative/iso_gdf/gdf_feature/gdf_areafeature.py@8437
Revision 8437, 2.5 KB checked in by mnagni, 7 years ago (diff)

Added a new function to ascore.utils in order to synchronize classes before committing to database

The following constraints has been added to the official model:

MO_ObservationCollection:member:CEDA_Observation
MO_ObservationCollection:phenomenonTime:TM_GeometricPrimitive
MO_Project:observationCollection:CEDA_ObservationCollection
MO_Observation:result:CEDA_Result
MO_Observation:inSupportOf:CEDA_Project
MO_Project:subProject:CEDA_Project
OM_Observation:procedure:CEDA_Process
OM_Observation:phenomenonTime:TM_GeometricPrimitive
MO_ResponsiblePartyFunctionValue:CEDA_RoleValue

  • Property svn:mime-type set to text/plain
Line 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21from ea_model.informative.iso_gdf.gdf_feature.gdf_simplefeature import  GDF_SimpleFeature
22from ascore.utils import has_value, collectionProofHash
23
24'''
25Created on 06-Jul-2012 07:43:12
26
27@author: mnagni
28'''
29
30class GDF_AreaFeature(GDF_SimpleFeature):
31        '''
32                Represents a data entity defined in a UML diagram and supposed to
33                be persisted in a relational database.
34 
35                This class has been genererated automatically using the Apache Velocity project.
36        '''
37        '''
38                Please note that any access to the inner attributes should be done using
39                the given get/set methods and NOT accessing them directly.
40        '''
41        def __init__(self):
42                self._gdf_simplefeature = GDF_SimpleFeature()   
43
44                self.attribute = None
45                self.theGDF_Polygon = None
46                self.id = None
47                self.theGDF_Face = []
48                self.category = None
49                self.edge = []
50                self.class_ = None
51                super(GDF_AreaFeature, self).__init__()
52        @property
53        def attribute(self):   
54                return self._gdf_simplefeature.attribute
55
56        @attribute.setter
57        def attribute(self, value):     
58                        self._gdf_simplefeature.attribute = value
59        @property
60        def theGDF_SemanticRelationship(self): 
61                return self._gdf_simplefeature.theGDF_SemanticRelationship
62
63        @theGDF_SemanticRelationship.setter
64        def theGDF_SemanticRelationship(self, value):   
65                        self._gdf_simplefeature.theGDF_SemanticRelationship = value
66        @property
67        def id(self):   
68                return self._gdf_simplefeature.id
69
70        @id.setter
71        def id(self, value):   
72                        self._gdf_simplefeature.id = value
73        @property
74        def category(self):     
75                return self._gdf_simplefeature.category
76
77        @category.setter
78        def category(self, value):     
79                        self._gdf_simplefeature.category = value
80        @property
81        def container(self):   
82                return self._gdf_simplefeature.container
83
84        @container.setter
85        def container(self, value):     
86                        self._gdf_simplefeature.container = value
87        @property
88        def class_(self):       
89                return self._gdf_simplefeature.class_
90
91        @class_.setter
92        def class_(self, value):       
93                        self._gdf_simplefeature.class_ = value
94
95        def synchronize(self):
96                pass
97
98        def __key(self):
99                return (self.attribute, self.theGDF_Polygon, self.theGDF_SemanticRelationship, self.id, self.theGDF_Face, self.category, self.container, self.edge, self.class_)
100
101        def __eq__(self, y):
102                if type(self) != type(y):
103                        return False
104                '''
105                Cannot compare classes which do not define a "__key" attribute
106                '''
107                if hasattr(self, '_%s__key' % (type(self).__name__)) and hasattr(y, '_%s__key' % (type(y).__name__)):
108                        return self.__key() == y.__key()
109                return id(self) == id(y)
110
111        def __hash__(self):
112                return collectionProofHash(self.__key())
Note: See TracBrowser for help on using the repository browser.