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/primitive
Files:
24 edited

Legend:

Unmodified
Added
Removed
  • mauRepo/MolesManager/trunk/src/ea_model/iso_19103_2005_schema_language/basic_types/primitive/date_and_time/clocktime.py

    r8074 r8086  
     1 
    12 
    23 
     
    1718 
    1819''' 
    19 Created on 26-Jan-2012 16:07:32 
     20Created on 03-Feb-2012 10:41:08 
    2021 
    2122@author: mnagni 
     
    4849 
    4950 
     51 
     52    def __key(self): 
     53        return (self.timeZone, self.second, self.minute, self.hour) 
     54 
     55    def __eq__(x, y): 
     56        ''' 
     57        Cannot compare classes which do not define a "__key" attribute  
     58        ''' 
     59        if hasattr(x, '_%s__key' % (type(x).__name__)) and hasattr(y, '_%s__key' % (type(y).__name__)): 
     60            return x.__key() == y.__key() 
     61        return id(x) == id(y) 
     62 
     63    def __hash__(self): 
     64        return hash(self.__key()) 
  • mauRepo/MolesManager/trunk/src/ea_model/iso_19103_2005_schema_language/basic_types/primitive/date_and_time/date.py

    r8074 r8086  
     1 
    12 
    23 
     
    1718 
    1819''' 
    19 Created on 26-Jan-2012 16:07:37 
     20Created on 03-Feb-2012 10:41:15 
    2021 
    2122@author: mnagni 
     
    5152 
    5253 
     54 
     55    def __key(self): 
     56        return (self.day, self.year, self.century, self.month, self.precision) 
     57 
     58    def __eq__(x, y): 
     59        ''' 
     60        Cannot compare classes which do not define a "__key" attribute  
     61        ''' 
     62        if hasattr(x, '_%s__key' % (type(x).__name__)) and hasattr(y, '_%s__key' % (type(y).__name__)): 
     63            return x.__key() == y.__key() 
     64        return id(x) == id(y) 
     65 
     66    def __hash__(self): 
     67        return hash(self.__key()) 
  • mauRepo/MolesManager/trunk/src/ea_model/iso_19103_2005_schema_language/basic_types/primitive/date_and_time/dateprecision.py

    r8074 r8086  
     1 
    12 
    23 
     
    1718 
    1819''' 
    19 Created on 26-Jan-2012 16:07:31 
     20Created on 03-Feb-2012 10:41:17 
    2021 
    2122@author: mnagni 
     
    4243 
    4344 
     45 
     46    def __key(self): 
     47        return (self.determinationMethod, self.precision) 
     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/primitive/date_and_time/datetime.py

    r8074 r8086  
     1 
    12 
    23 
     
    1920 
    2021''' 
    21 Created on 26-Jan-2012 16:07:34 
     22Created on 03-Feb-2012 10:41:12 
    2223 
    2324@author: mnagni 
    2425''' 
    2526 
    26 class DateTime(Date,ClockTime): 
     27class DateTime(ClockTime,Date): 
    2728    ''' 
    2829        Represents a data entity defined in a UML diagram and supposed to  
     
    3637    ''' 
    3738    def __init__(self): 
     39        self._date = Date()      
    3840        self._clocktime = ClockTime()    
    39         self._date = Date()      
    4041 
    4142        self.timeZone = None 
     
    5657    @timeZone.setter 
    5758    def timeZone(self, value): 
    58              self._clocktime.timeZone = value 
     59            self._clocktime.timeZone = value 
    5960 
    6061    @property 
     
    6465    @second.setter 
    6566    def second(self, value): 
    66              self._clocktime.second = value 
     67            self._clocktime.second = value 
    6768 
    6869    @property 
     
    7273    @day.setter 
    7374    def day(self, value): 
    74              self._date.day = value 
     75            self._date.day = value 
    7576 
    7677    @property 
     
    8081    @year.setter 
    8182    def year(self, value): 
    82              self._date.year = value 
     83            self._date.year = value 
    8384 
    8485    @property 
     
    8889    @century.setter 
    8990    def century(self, value): 
    90              self._date.century = value 
     91            self._date.century = value 
    9192 
    9293    @property 
     
    9697    @month.setter 
    9798    def month(self, value): 
    98              self._date.month = value 
     99            self._date.month = value 
    99100 
    100101    @property 
     
    104105    @minute.setter 
    105106    def minute(self, value): 
    106              self._clocktime.minute = value 
     107            self._clocktime.minute = value 
    107108 
    108109    @property 
     
    112113    @precision.setter 
    113114    def precision(self, value): 
    114              self._date.precision = value 
     115            self._date.precision = value 
    115116 
    116117    @property 
     
    120121    @hour.setter 
    121122    def hour(self, value): 
    122              self._clocktime.hour = value 
     123            self._clocktime.hour = value 
     124 
     125    def __key(self): 
     126        return (self.timeZone, self.second, self.day, self.year, self.century, self.month, self.minute, self.precision, self.hour) 
     127 
     128    def __eq__(x, y): 
     129        ''' 
     130        Cannot compare classes which do not define a "__key" attribute  
     131        ''' 
     132        if hasattr(x, '_%s__key' % (type(x).__name__)) and hasattr(y, '_%s__key' % (type(y).__name__)): 
     133            return x.__key() == y.__key() 
     134        return id(x) == id(y) 
     135 
     136    def __hash__(self): 
     137        return hash(self.__key()) 
  • mauRepo/MolesManager/trunk/src/ea_model/iso_19103_2005_schema_language/basic_types/primitive/enumerations/bit.py

    r8074 r8086  
     1 
    12 
    23 
     
    1819 
    1920''' 
    20 Created on 26-Jan-2012 16:07:29 
     21Created on 03-Feb-2012 10:41:18 
    2122 
    2223@author: mnagni 
  • mauRepo/MolesManager/trunk/src/ea_model/iso_19103_2005_schema_language/basic_types/primitive/enumerations/digit.py

    r8074 r8086  
     1 
    12 
    23 
     
    1819 
    1920''' 
    20 Created on 26-Jan-2012 16:07:35 
     21Created on 03-Feb-2012 10:41:13 
    2122 
    2223@author: mnagni 
     
    3031        This class has been genererated automatically using the Apache Velocity project. 
    3132    ''' 
     33    en_eight = "eight"  
     34    en_two = "two"  
     35    en_six = "six"  
     36    en_four = "four"  
     37    en_five = "five"  
     38    en_three = "three"  
     39    en_zero = "zero"  
     40    en_nine = "nine"  
     41    en_seven = "seven"  
    3242    en_one = "one"  
    33     en_four = "four"  
    34     en_three = "three"  
    35     en_five = "five"  
    36     en_seven = "seven"  
    37     en_six = "six"  
    38     en_two = "two"  
    39     en_nine = "nine"  
    40     en_eight = "eight"  
    41     en_zero = "zero"  
  • mauRepo/MolesManager/trunk/src/ea_model/iso_19103_2005_schema_language/basic_types/primitive/enumerations/sign.py

    r8074 r8086  
     1 
    12 
    23 
     
    1819 
    1920''' 
    20 Created on 26-Jan-2012 16:07:34 
     21Created on 03-Feb-2012 10:41:14 
    2122 
    2223@author: mnagni 
  • mauRepo/MolesManager/trunk/src/ea_model/iso_19103_2005_schema_language/basic_types/primitive/multiplicities/multiplicity.py

    r8074 r8086  
     1 
    12 
    23 
     
    1718 
    1819''' 
    19 Created on 26-Jan-2012 16:07:35 
     20Created on 03-Feb-2012 10:41:17 
    2021 
    2122@author: mnagni 
     
    3940 
    4041 
     42 
     43    def __key(self): 
     44        return (self.range) 
     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/primitive/multiplicities/multiplicityrange.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 
     
    4243 
    4344 
     45 
     46    def __key(self): 
     47        return (self.upper, self.lower) 
     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/primitive/numerics/decimal.py

    r8074 r8086  
     1 
    12 
    23 
     
    1819 
    1920''' 
    20 Created on 26-Jan-2012 16:07:38 
     21Created on 03-Feb-2012 10:41:18 
    2122 
    2223@author: mnagni 
     
    3839 
    3940        super(Decimal, self).__init__() 
     41 
     42    def __key(self): 
     43        return () 
     44 
     45    def __eq__(x, y): 
     46        ''' 
     47        Cannot compare classes which do not define a "__key" attribute  
     48        ''' 
     49        if hasattr(x, '_%s__key' % (type(x).__name__)) and hasattr(y, '_%s__key' % (type(y).__name__)): 
     50            return x.__key() == y.__key() 
     51        return id(x) == id(y) 
     52 
     53    def __hash__(self): 
     54        return hash(self.__key()) 
  • mauRepo/MolesManager/trunk/src/ea_model/iso_19103_2005_schema_language/basic_types/primitive/numerics/integer.py

    r8074 r8086  
     1 
    12 
    23 
     
    1819 
    1920''' 
    20 Created on 26-Jan-2012 16:07:38 
     21Created on 03-Feb-2012 10:41:12 
    2122 
    2223@author: mnagni 
     
    3839 
    3940        super(Integer, self).__init__() 
     41 
     42    def __key(self): 
     43        return () 
     44 
     45    def __eq__(x, y): 
     46        ''' 
     47        Cannot compare classes which do not define a "__key" attribute  
     48        ''' 
     49        if hasattr(x, '_%s__key' % (type(x).__name__)) and hasattr(y, '_%s__key' % (type(y).__name__)): 
     50            return x.__key() == y.__key() 
     51        return id(x) == id(y) 
     52 
     53    def __hash__(self): 
     54        return hash(self.__key()) 
  • mauRepo/MolesManager/trunk/src/ea_model/iso_19103_2005_schema_language/basic_types/primitive/numerics/number.py

    r8074 r8086  
     1 
    12 
    23 
     
    1718 
    1819''' 
    19 Created on 26-Jan-2012 16:07:32 
     20Created on 03-Feb-2012 10:41:13 
    2021 
    2122@author: mnagni 
     
    3637 
    3738        super(Number, 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/primitive/numerics/real.py

    r8074 r8086  
     1 
    12 
    23 
     
    1819 
    1920''' 
    20 Created on 26-Jan-2012 16:07:34 
     21Created on 03-Feb-2012 10:41:16 
    2122 
    2223@author: mnagni 
     
    3839 
    3940        super(Real, self).__init__() 
     41 
     42    def __key(self): 
     43        return () 
     44 
     45    def __eq__(x, y): 
     46        ''' 
     47        Cannot compare classes which do not define a "__key" attribute  
     48        ''' 
     49        if hasattr(x, '_%s__key' % (type(x).__name__)) and hasattr(y, '_%s__key' % (type(y).__name__)): 
     50            return x.__key() == y.__key() 
     51        return id(x) == id(y) 
     52 
     53    def __hash__(self): 
     54        return hash(self.__key()) 
  • mauRepo/MolesManager/trunk/src/ea_model/iso_19103_2005_schema_language/basic_types/primitive/numerics/unlimitedinteger.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 
     
    4243 
    4344 
     45 
     46    def __key(self): 
     47        return (self.value, self.isInfinite) 
     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/primitive/numerics/vector.py

    r8074 r8086  
     1 
    12 
    23 
     
    1718 
    1819''' 
    19 Created on 26-Jan-2012 16:07:35 
     20Created on 03-Feb-2012 10:41:12 
    2021 
    2122@author: mnagni 
     
    4243 
    4344 
     45 
     46    def __key(self): 
     47        return (self.ordinates, self.dimension) 
     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/primitive/text/character.py

    r8074 r8086  
     1 
    12 
    23 
     
    1718 
    1819''' 
    19 Created on 26-Jan-2012 16:07:28 
     20Created on 03-Feb-2012 10:41:16 
    2021 
    2122@author: mnagni 
     
    3637 
    3738        super(Character, 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/primitive/text/charactersetcode.py

    r8074 r8086  
     1 
    12 
    23 
     
    1819 
    1920''' 
    20 Created on 26-Jan-2012 16:07:35 
     21Created on 03-Feb-2012 10:41:12 
    2122 
    2223@author: mnagni 
     
    3031        This class has been genererated automatically using the Apache Velocity project. 
    3132    ''' 
     33    cl_iso8859 = "ISO8859"  
     34    cl_iso10646_2 = "ISO10646-2"  
    3235    cl_iso10646_1 = "ISO10646-1"  
    33     cl_iso10646_2 = "ISO10646-2"  
    34     cl_iso8859 = "ISO8859"  
  • mauRepo/MolesManager/trunk/src/ea_model/iso_19103_2005_schema_language/basic_types/primitive/text/ocl.py

    r8074 r8086  
     1 
    12 
    23 
     
    1819 
    1920''' 
    20 Created on 26-Jan-2012 16:07:38 
     21Created on 03-Feb-2012 10:41:18 
    2122 
    2223@author: mnagni 
     
    4950    @size.setter 
    5051    def size(self, value): 
    51              self._characterstring.size = value 
     52            self._characterstring.size = value 
    5253 
    5354    @property 
     
    5758    @characterSet.setter 
    5859    def characterSet(self, value): 
    59              self._characterstring.characterSet = value 
     60            self._characterstring.characterSet = value 
    6061 
    6162    @property 
     
    6566    @elements.setter 
    6667    def elements(self, value): 
    67              self._characterstring.elements = value 
     68            self._characterstring.elements = value 
    6869 
    6970    @property 
     
    7374    @maxLength.setter 
    7475    def maxLength(self, value): 
    75              self._characterstring.maxLength = value 
     76            self._characterstring.maxLength = value 
     77 
     78    def __key(self): 
     79        return (self.size, self.characterSet, self.elements, self.maxLength) 
     80 
     81    def __eq__(x, y): 
     82        ''' 
     83        Cannot compare classes which do not define a "__key" attribute  
     84        ''' 
     85        if hasattr(x, '_%s__key' % (type(x).__name__)) and hasattr(y, '_%s__key' % (type(y).__name__)): 
     86            return x.__key() == y.__key() 
     87        return id(x) == id(y) 
     88 
     89    def __hash__(self): 
     90        return hash(self.__key()) 
  • mauRepo/MolesManager/trunk/src/ea_model/iso_19103_2005_schema_language/basic_types/primitive/truth/boolean.py

    r8074 r8086  
     1 
    12 
    23 
     
    1819 
    1920''' 
    20 Created on 26-Jan-2012 16:07:35 
     21Created on 03-Feb-2012 10:41:18 
    2122 
    2223@author: mnagni 
     
    3031        This class has been genererated automatically using the Apache Velocity project. 
    3132    ''' 
     33    en_true = "TRUE"  
    3234    en_false = "FALSE"  
    33     en_true = "TRUE"  
  • mauRepo/MolesManager/trunk/src/ea_model/iso_19103_2005_schema_language/basic_types/primitive/truth/continuoustruth.py

    r8074 r8086  
     1 
    12 
    23 
     
    1819 
    1920''' 
    20 Created on 26-Jan-2012 16:07:33 
     21Created on 03-Feb-2012 10:41:17 
    2122 
    2223@author: mnagni 
     
    3839 
    3940        super(ContinuousTruth, self).__init__() 
     41 
     42    def __key(self): 
     43        return () 
     44 
     45    def __eq__(x, y): 
     46        ''' 
     47        Cannot compare classes which do not define a "__key" attribute  
     48        ''' 
     49        if hasattr(x, '_%s__key' % (type(x).__name__)) and hasattr(y, '_%s__key' % (type(y).__name__)): 
     50            return x.__key() == y.__key() 
     51        return id(x) == id(y) 
     52 
     53    def __hash__(self): 
     54        return hash(self.__key()) 
  • mauRepo/MolesManager/trunk/src/ea_model/iso_19103_2005_schema_language/basic_types/primitive/truth/discretetruth.py

    r8074 r8086  
     1 
    12 
    23 
     
    1819 
    1920''' 
    20 Created on 26-Jan-2012 16:07:41 
     21Created on 03-Feb-2012 10:41:14 
    2122 
    2223@author: mnagni 
     
    3839 
    3940        super(DiscreteTruth, self).__init__() 
     41 
     42    def __key(self): 
     43        return () 
     44 
     45    def __eq__(x, y): 
     46        ''' 
     47        Cannot compare classes which do not define a "__key" attribute  
     48        ''' 
     49        if hasattr(x, '_%s__key' % (type(x).__name__)) and hasattr(y, '_%s__key' % (type(y).__name__)): 
     50            return x.__key() == y.__key() 
     51        return id(x) == id(y) 
     52 
     53    def __hash__(self): 
     54        return hash(self.__key()) 
  • mauRepo/MolesManager/trunk/src/ea_model/iso_19103_2005_schema_language/basic_types/primitive/truth/logical.py

    r8074 r8086  
     1 
    12 
    23 
     
    1819 
    1920''' 
    20 Created on 26-Jan-2012 16:07:34 
     21Created on 03-Feb-2012 10:41:17 
    2122 
    2223@author: mnagni 
  • mauRepo/MolesManager/trunk/src/ea_model/iso_19103_2005_schema_language/basic_types/primitive/truth/probability.py

    r8074 r8086  
     1 
    12 
    23 
     
    1819 
    1920''' 
    20 Created on 26-Jan-2012 16:07:35 
     21Created on 03-Feb-2012 10:41:18 
    2122 
    2223@author: mnagni 
     
    4142 
    4243 
     44 
     45    def __key(self): 
     46        return (self.value) 
     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/primitive/truth/truth.py

    r8074 r8086  
     1 
    12 
    23 
     
    1718 
    1819''' 
    19 Created on 26-Jan-2012 16:07:36 
     20Created on 03-Feb-2012 10:41:09 
    2021 
    2122@author: mnagni 
     
    3637 
    3738        super(Truth, 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.