source: mauRepo/CedaMolesModel/trunk/ceda_moles_model/ea_model/iso_19109_2005_application_schema/general_feature_model/gf_eventtype.py @ 8437

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/mauRepo/CedaMolesModel/trunk/ceda_moles_model/ea_model/iso_19109_2005_application_schema/general_feature_model/gf_eventtype.py@8437
Revision 8437, 3.9 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.iso_19109_2005_application_schema.general_feature_model.gf_temporalattributetype import  GF_TemporalAttributeType
22from ascore.utils import has_value, collectionProofHash
23
24'''
25Created on 06-Jul-2012 07:43:16
26
27@author: mnagni
28'''
29
30class GF_EventType(GF_TemporalAttributeType):
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._gf_temporalattributetype = GF_TemporalAttributeType()     
43
44                self.valueDomain = None
45                self.memberName = None
46                self.valueType = None
47                self.theGF_FeatureType = None
48                self.definition = None
49                self.characterize = None
50                self.cardinality = None
51                super(GF_EventType, self).__init__()
52        @property
53        def propertyTypeMetadata(self):
54                return self._gf_temporalattributetype.propertyTypeMetadata
55
56        @propertyTypeMetadata.setter
57        def propertyTypeMetadata(self, value): 
58                        self._gf_temporalattributetype.propertyTypeMetadata = value
59        @property
60        def valueDomain(self): 
61                return self._gf_temporalattributetype.valueDomain
62
63        @valueDomain.setter
64        def valueDomain(self, value):   
65                        self._gf_temporalattributetype.valueDomain = value
66        @property
67        def characterizeBy(self):       
68                return self._gf_temporalattributetype.characterizeBy
69
70        @characterizeBy.setter
71        def characterizeBy(self, value):       
72                        self._gf_temporalattributetype.characterizeBy = value
73        @property
74        def featureAttributeMetadata(self):     
75                return self._gf_temporalattributetype.featureAttributeMetadata
76
77        @featureAttributeMetadata.setter
78        def featureAttributeMetadata(self, value):     
79                        self._gf_temporalattributetype.featureAttributeMetadata = value
80        @property
81        def memberName(self):   
82                return self._gf_temporalattributetype.memberName
83
84        @memberName.setter
85        def memberName(self, value):   
86                        self._gf_temporalattributetype.memberName = value
87        @property
88        def constrainedBy(self):       
89                return self._gf_temporalattributetype.constrainedBy
90
91        @constrainedBy.setter
92        def constrainedBy(self, value):
93                        self._gf_temporalattributetype.constrainedBy = value
94        @property
95        def valueType(self):   
96                return self._gf_temporalattributetype.valueType
97
98        @valueType.setter
99        def valueType(self, value):     
100                        self._gf_temporalattributetype.valueType = value
101        @property
102        def theGF_FeatureType(self):   
103                return self._gf_temporalattributetype.theGF_FeatureType
104
105        @theGF_FeatureType.setter
106        def theGF_FeatureType(self, value):     
107                        self._gf_temporalattributetype.theGF_FeatureType = value
108        @property
109        def definition(self):   
110                return self._gf_temporalattributetype.definition
111
112        @definition.setter
113        def definition(self, value):   
114                        self._gf_temporalattributetype.definition = value
115        @property
116        def characterize(self):
117                return self._gf_temporalattributetype.characterize
118
119        @characterize.setter
120        def characterize(self, value): 
121                        self._gf_temporalattributetype.characterize = value
122        @property
123        def cardinality(self): 
124                return self._gf_temporalattributetype.cardinality
125
126        @cardinality.setter
127        def cardinality(self, value):   
128                        self._gf_temporalattributetype.cardinality = value
129
130        def synchronize(self):
131                pass
132
133        def __key(self):
134                return (self.propertyTypeMetadata, self.valueDomain, self.characterizeBy, self.featureAttributeMetadata, self.memberName, self.constrainedBy, self.valueType, self.theGF_FeatureType, self.definition, self.characterize, self.cardinality)
135
136        def __eq__(self, y):
137                if type(self) != type(y):
138                        return False
139                '''
140                Cannot compare classes which do not define a "__key" attribute
141                '''
142                if hasattr(self, '_%s__key' % (type(self).__name__)) and hasattr(y, '_%s__key' % (type(y).__name__)):
143                        return self.__key() == y.__key()
144                return id(self) == id(y)
145
146        def __hash__(self):
147                return collectionProofHash(self.__key())
Note: See TracBrowser for help on using the repository browser.