source: mauRepo/MolesManager/trunk/src/ea_model/iso_19107_2003_spatial_schema/topology/topological_primitive/tp_solidboundary.py @ 8086

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/mauRepo/MolesManager/trunk/src/ea_model/iso_19107_2003_spatial_schema/topology/topological_primitive/tp_solidboundary.py@8086
Revision 8086, 1.4 KB checked in by mnagni, 8 years ago (diff)

Fixed the multiple CI_Party INSERT in the DB
Refactored the ingestion thanks to the new eq method in the imported classes DB library

Line 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18from ea_model.iso_19107_2003_spatial_schema.topology.topological_primitive.tp_primitiveboundary import  TP_PrimitiveBoundary
19
20'''
21Created on 03-Feb-2012 10:41:17
22
23@author: mnagni
24'''
25
26class TP_SolidBoundary(TP_PrimitiveBoundary):
27    '''
28        Represents a data entity defined in a UML diagram and supposed to
29        be persisted in a relational database.
30 
31        This class has been genererated automatically using the Apache Velocity project.
32    '''
33    '''
34        Please note that any access to the inner attributes should be done using
35        the given get/set methods and NOT accessing them directly.
36    '''
37    def __init__(self):
38        self._tp_primitiveboundary = TP_PrimitiveBoundary()     
39
40        self.exterior = None
41        self.term = []
42        self.interior = []
43        super(TP_SolidBoundary, self).__init__()
44
45
46
47    @property
48    def term(self):
49        return self._tp_primitiveboundary.term
50
51    @term.setter
52    def term(self, value):
53            self._tp_primitiveboundary.term = value
54
55
56
57    def __key(self):
58        return (self.exterior, self.term, self.interior)
59
60    def __eq__(x, y):
61        '''
62        Cannot compare classes which do not define a "__key" attribute
63        '''
64        if hasattr(x, '_%s__key' % (type(x).__name__)) and hasattr(y, '_%s__key' % (type(y).__name__)):
65            return x.__key() == y.__key()
66        return id(x) == id(y)
67
68    def __hash__(self):
69        return hash(self.__key())
Note: See TracBrowser for help on using the repository browser.