source: mauRepo/MolesManager/trunk/src/ea_model/iso_19103_2005_schema_language/basic_types/implementation/records_and_class_metadata/recordschema.py @ 8089

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/mauRepo/MolesManager/trunk/src/ea_model/iso_19103_2005_schema_language/basic_types/implementation/records_and_class_metadata/recordschema.py@8089
Revision 8089, 2.1 KB checked in by mnagni, 8 years ago (diff)

Played with DOJO
New EA library
Addede CEDA_Process to the migration

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_19103_2005_schema_language.basic_types.implementation.records_and_class_metadata.schema import  Schema
22from ascore.utils import has_value
23
24'''
25Created on 14-Feb-2012 17:19:36
26
27@author: mnagni
28'''
29
30class RecordSchema(Schema):
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._schema = Schema()         
43
44        self.name = []
45        self.isGlobal = None
46        self.schemaName = None
47        self.acceptableClassList = []
48        self.description = None
49        super(RecordSchema, self).__init__()
50
51    @property
52    def name(self):     
53        return self._schema.name
54
55    @name.setter
56    def name(self, value):     
57            self._schema.name = value
58
59    @property
60    def isGlobal(self): 
61        return self._schema.isGlobal
62
63    @isGlobal.setter
64    def isGlobal(self, value): 
65            self._schema.isGlobal = value
66
67    @property
68    def schemaName(self):       
69        return self._schema.schemaName
70
71    @schemaName.setter
72    def schemaName(self, value):       
73            self._schema.schemaName = value
74
75    @property
76    def acceptableClassList(self):     
77        return self._schema.acceptableClassList
78
79    @acceptableClassList.setter
80    def acceptableClassList(self, value):       
81            self._schema.acceptableClassList = value
82
83    def __key(self):
84        return (self.name, self.isGlobal, self.schemaName, self.acceptableClassList, self.description)
85
86    def __eq__(self, y):
87        '''
88        Cannot compare classes which do not define a "__key" attribute
89        '''
90        if hasattr(self, '_%s__key' % (type(self).__name__)) and hasattr(y, '_%s__key' % (type(y).__name__)):
91            return self.__key() == y.__key()
92        return id(self) == id(y)
93
94    def __hash__(self):
95        return hash(self.__key())
Note: See TracBrowser for help on using the repository browser.