Ignore:
Timestamp:
03/02/12 13:48:25 (8 years ago)
Author:
mnagni
Message:

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

Location:
mauRepo/MolesManager/trunk/src/ea_model/iso_19103_2005_schema_language/basic_types/implementation/collections
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • mauRepo/MolesManager/trunk/src/ea_model/iso_19103_2005_schema_language/basic_types/implementation/collections/bag.py

    r8074 r8086  
     1 
    12 
    23 
     
    1819 
    1920''' 
    20 Created on 26-Jan-2012 16:07:40 
     21Created on 03-Feb-2012 10:41:13 
    2122 
    2223@author: mnagni 
     
    4142 
    4243 
     44 
     45    def __key(self): 
     46        return (self.element) 
     47 
     48    def __eq__(x, y): 
     49        ''' 
     50        Cannot compare classes which do not define a "__key" attribute  
     51        ''' 
     52        if hasattr(x, '_%s__key' % (type(x).__name__)) and hasattr(y, '_%s__key' % (type(y).__name__)): 
     53            return x.__key() == y.__key() 
     54        return id(x) == id(y) 
     55 
     56    def __hash__(self): 
     57        return hash(self.__key()) 
  • mauRepo/MolesManager/trunk/src/ea_model/iso_19103_2005_schema_language/basic_types/implementation/collections/circularsequence.py

    r8074 r8086  
     1 
    12 
    23 
     
    1819 
    1920''' 
    20 Created on 26-Jan-2012 16:07:34 
     21Created on 03-Feb-2012 10:41:12 
    2122 
    2223@author: mnagni 
     
    4748    @length.setter 
    4849    def length(self, value): 
    49              self._sequence.length = value 
     50            self._sequence.length = value 
    5051 
    5152    @property 
     
    5556    @element.setter 
    5657    def element(self, value): 
    57              self._sequence.element = value 
     58            self._sequence.element = value 
     59 
     60    def __key(self): 
     61        return (self.length, self.element) 
     62 
     63    def __eq__(x, y): 
     64        ''' 
     65        Cannot compare classes which do not define a "__key" attribute  
     66        ''' 
     67        if hasattr(x, '_%s__key' % (type(x).__name__)) and hasattr(y, '_%s__key' % (type(y).__name__)): 
     68            return x.__key() == y.__key() 
     69        return id(x) == id(y) 
     70 
     71    def __hash__(self): 
     72        return hash(self.__key()) 
  • mauRepo/MolesManager/trunk/src/ea_model/iso_19103_2005_schema_language/basic_types/implementation/collections/code.py

    r8074 r8086  
     1 
    12 
    23 
     
    1920 
    2021''' 
    21 Created on 26-Jan-2012 16:07:41 
     22Created on 03-Feb-2012 10:41:18 
    2223 
    2324@author: mnagni 
     
    3132        This class has been genererated automatically using the Apache Velocity project. 
    3233    ''' 
    33     types = {'asCharacter':Text,'asNumber':NUMERIC} 
     34    types = {'asNumber':NUMERIC,'asCharacter':Text} 
  • mauRepo/MolesManager/trunk/src/ea_model/iso_19103_2005_schema_language/basic_types/implementation/collections/codelist.py

    r8074 r8086  
     1 
    12 
    23 
     
    1718 
    1819''' 
    19 Created on 26-Jan-2012 16:07:30 
     20Created on 03-Feb-2012 10:41:13 
    2021 
    2122@author: mnagni 
     
    3940 
    4041 
     42 
     43    def __key(self): 
     44        return (self.actualValue) 
     45 
     46    def __eq__(x, y): 
     47        ''' 
     48        Cannot compare classes which do not define a "__key" attribute  
     49        ''' 
     50        if hasattr(x, '_%s__key' % (type(x).__name__)) and hasattr(y, '_%s__key' % (type(y).__name__)): 
     51            return x.__key() == y.__key() 
     52        return id(x) == id(y) 
     53 
     54    def __hash__(self): 
     55        return hash(self.__key()) 
  • mauRepo/MolesManager/trunk/src/ea_model/iso_19103_2005_schema_language/basic_types/implementation/collections/collection.py

    r8074 r8086  
     1 
    12 
    23 
     
    1718 
    1819''' 
    19 Created on 26-Jan-2012 16:07:37 
     20Created on 03-Feb-2012 10:41:11 
    2021 
    2122@author: mnagni 
     
    3637 
    3738        super(Collection, self).__init__() 
     39 
     40    def __key(self): 
     41        return () 
     42 
     43    def __eq__(x, y): 
     44        ''' 
     45        Cannot compare classes which do not define a "__key" attribute  
     46        ''' 
     47        if hasattr(x, '_%s__key' % (type(x).__name__)) and hasattr(y, '_%s__key' % (type(y).__name__)): 
     48            return x.__key() == y.__key() 
     49        return id(x) == id(y) 
     50 
     51    def __hash__(self): 
     52        return hash(self.__key()) 
  • mauRepo/MolesManager/trunk/src/ea_model/iso_19103_2005_schema_language/basic_types/implementation/collections/dictionary.py

    r8074 r8086  
     1 
    12 
    23 
     
    1718 
    1819''' 
    19 Created on 26-Jan-2012 16:07:39 
     20Created on 03-Feb-2012 10:41:18 
    2021 
    2122@author: mnagni 
     
    3940 
    4041 
     42 
     43    def __key(self): 
     44        return (self.elements) 
     45 
     46    def __eq__(x, y): 
     47        ''' 
     48        Cannot compare classes which do not define a "__key" attribute  
     49        ''' 
     50        if hasattr(x, '_%s__key' % (type(x).__name__)) and hasattr(y, '_%s__key' % (type(y).__name__)): 
     51            return x.__key() == y.__key() 
     52        return id(x) == id(y) 
     53 
     54    def __hash__(self): 
     55        return hash(self.__key()) 
  • mauRepo/MolesManager/trunk/src/ea_model/iso_19103_2005_schema_language/basic_types/implementation/collections/keytype.py

    r8074 r8086  
     1 
    12 
    23 
     
    1718 
    1819''' 
    19 Created on 26-Jan-2012 16:07:39 
     20Created on 03-Feb-2012 10:41:12 
    2021 
    2122@author: mnagni 
     
    3637 
    3738        super(KeyType, self).__init__() 
     39 
     40    def __key(self): 
     41        return () 
     42 
     43    def __eq__(x, y): 
     44        ''' 
     45        Cannot compare classes which do not define a "__key" attribute  
     46        ''' 
     47        if hasattr(x, '_%s__key' % (type(x).__name__)) and hasattr(y, '_%s__key' % (type(y).__name__)): 
     48            return x.__key() == y.__key() 
     49        return id(x) == id(y) 
     50 
     51    def __hash__(self): 
     52        return hash(self.__key()) 
  • mauRepo/MolesManager/trunk/src/ea_model/iso_19103_2005_schema_language/basic_types/implementation/collections/keyvaluepair.py

    r8074 r8086  
     1 
    12 
    23 
     
    1718 
    1819''' 
    19 Created on 26-Jan-2012 16:07:33 
     20Created on 03-Feb-2012 10:41:14 
    2021 
    2122@author: mnagni 
     
    4243 
    4344 
     45 
     46    def __key(self): 
     47        return (self.value, self.key) 
     48 
     49    def __eq__(x, y): 
     50        ''' 
     51        Cannot compare classes which do not define a "__key" attribute  
     52        ''' 
     53        if hasattr(x, '_%s__key' % (type(x).__name__)) and hasattr(y, '_%s__key' % (type(y).__name__)): 
     54            return x.__key() == y.__key() 
     55        return id(x) == id(y) 
     56 
     57    def __hash__(self): 
     58        return hash(self.__key()) 
  • mauRepo/MolesManager/trunk/src/ea_model/iso_19103_2005_schema_language/basic_types/implementation/collections/sequence.py

    r8074 r8086  
     1 
    12 
    23 
     
    1819 
    1920''' 
    20 Created on 26-Jan-2012 16:07:37 
     21Created on 03-Feb-2012 10:41:14 
    2122 
    2223@author: mnagni 
     
    4445 
    4546 
     47 
     48    def __key(self): 
     49        return (self.length, self.element) 
     50 
     51    def __eq__(x, y): 
     52        ''' 
     53        Cannot compare classes which do not define a "__key" attribute  
     54        ''' 
     55        if hasattr(x, '_%s__key' % (type(x).__name__)) and hasattr(y, '_%s__key' % (type(y).__name__)): 
     56            return x.__key() == y.__key() 
     57        return id(x) == id(y) 
     58 
     59    def __hash__(self): 
     60        return hash(self.__key()) 
  • mauRepo/MolesManager/trunk/src/ea_model/iso_19103_2005_schema_language/basic_types/implementation/collections/set.py

    r8074 r8086  
     1 
    12 
    23 
     
    1819 
    1920''' 
    20 Created on 26-Jan-2012 16:07:32 
     21Created on 03-Feb-2012 10:41:18 
    2122 
    2223@author: mnagni 
     
    4445 
    4546 
     47 
     48    def __key(self): 
     49        return (self.size, self.elements) 
     50 
     51    def __eq__(x, y): 
     52        ''' 
     53        Cannot compare classes which do not define a "__key" attribute  
     54        ''' 
     55        if hasattr(x, '_%s__key' % (type(x).__name__)) and hasattr(y, '_%s__key' % (type(y).__name__)): 
     56            return x.__key() == y.__key() 
     57        return id(x) == id(y) 
     58 
     59    def __hash__(self): 
     60        return hash(self.__key()) 
  • mauRepo/MolesManager/trunk/src/ea_model/iso_19103_2005_schema_language/basic_types/implementation/collections/t.py

    r8074 r8086  
     1 
    12 
    23 
     
    1718 
    1819''' 
    19 Created on 26-Jan-2012 16:07:41 
     20Created on 03-Feb-2012 10:41:16 
    2021 
    2122@author: mnagni 
     
    3637 
    3738        super(T, self).__init__() 
     39 
     40    def __key(self): 
     41        return () 
     42 
     43    def __eq__(x, y): 
     44        ''' 
     45        Cannot compare classes which do not define a "__key" attribute  
     46        ''' 
     47        if hasattr(x, '_%s__key' % (type(x).__name__)) and hasattr(y, '_%s__key' % (type(y).__name__)): 
     48            return x.__key() == y.__key() 
     49        return id(x) == id(y) 
     50 
     51    def __hash__(self): 
     52        return hash(self.__key()) 
  • mauRepo/MolesManager/trunk/src/ea_model/iso_19103_2005_schema_language/basic_types/implementation/collections/transfiniteset.py

    r8074 r8086  
     1 
    12 
    23 
     
    1718 
    1819''' 
    19 Created on 26-Jan-2012 16:07:39 
     20Created on 03-Feb-2012 10:41:13 
    2021 
    2122@author: mnagni 
     
    3637 
    3738        super(TransfiniteSet, self).__init__() 
     39 
     40    def __key(self): 
     41        return () 
     42 
     43    def __eq__(x, y): 
     44        ''' 
     45        Cannot compare classes which do not define a "__key" attribute  
     46        ''' 
     47        if hasattr(x, '_%s__key' % (type(x).__name__)) and hasattr(y, '_%s__key' % (type(y).__name__)): 
     48            return x.__key() == y.__key() 
     49        return id(x) == id(y) 
     50 
     51    def __hash__(self): 
     52        return hash(self.__key()) 
  • mauRepo/MolesManager/trunk/src/ea_model/iso_19103_2005_schema_language/basic_types/implementation/collections/valuetype.py

    r8074 r8086  
     1 
    12 
    23 
     
    1718 
    1819''' 
    19 Created on 26-Jan-2012 16:07:25 
     20Created on 03-Feb-2012 10:41:18 
    2021 
    2122@author: mnagni 
     
    3637 
    3738        super(ValueType, self).__init__() 
     39 
     40    def __key(self): 
     41        return () 
     42 
     43    def __eq__(x, y): 
     44        ''' 
     45        Cannot compare classes which do not define a "__key" attribute  
     46        ''' 
     47        if hasattr(x, '_%s__key' % (type(x).__name__)) and hasattr(y, '_%s__key' % (type(y).__name__)): 
     48            return x.__key() == y.__key() 
     49        return id(x) == id(y) 
     50 
     51    def __hash__(self): 
     52        return hash(self.__key()) 
Note: See TracChangeset for help on using the changeset viewer.