Ignore:
Timestamp:
26/06/12 21:44:46 (7 years ago)
Author:
mnagni
Message:

created wrong table composition

Location:
mauRepo/xmi2sqlalchemy/trunk/src/main
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • mauRepo/xmi2sqlalchemy/trunk/src/main/java/ndg/services/newmoon/velocity/python/GenerateTablesClosure.java

    r8393 r8411  
    205205 
    206206                        TableModel parent = processUMLclass(cm); 
    207                         String relName = parent.getAssociatedClass().getName().toLowerCase(); 
     207                        String relName = "_" + parent.getAssociatedClass().getName().toLowerCase(); 
    208208                        Relationship rl = new Relationship(child, parent, relName, false, false);                        
    209209                        ForeignKey fk = new ForeignKey(child, relName); 
  • mauRepo/xmi2sqlalchemy/trunk/src/main/resources/velocity/python/sqlAlchemyTables.vm

    r8393 r8411  
    44## tableModel - an instance of ClassModel class 
    55########################################################################## 
    6  
    7 ##macro( attributeType $attribute) 
    8 ##if(!$attribute.associatedType.associatedClass.name.equalsIgnoreCase('boolean') 
    9 ##&& ($attribute.associatedType.isCodeList() || $attribute.associatedType.isEnumeration())) 
    10 ##${attribute.associatedType.associatedClass.name}.db_type() 
    11 ##else${vh.substituteDBType($attribute)}#end 
    12 ##end 
    136#macro(checkUseAlter $fk, $fkName, $relName) 
    147, use_alter=True, name='fk_${fkName}_${relName}'#end 
     
    2720#set ($tn = ${tableModel.associatedClass.name.toLowerCase()}) 
    2821${tab}Column('id', Integer, Sequence('${tn}_id_seq'), primary_key=True), 
    29 ##if($tableModel.inherited && $tableModel.inherited.size() > 0) 
    30         ##foreach( $parent in $tableModel.inherited) 
    31                 ##set ($pn = ${parent.associatedClass.name.toLowerCase()}) 
    32                 ##${tab}Column('_${pn}', Integer, ForeignKey('${pn}.${pn}_id')),#end 
    33 ##end 
    3422#end 
    3523 
     
    6553#column($attribute) 
    6654#end 
    67 ##${tab}#superColumn($tableModel) 
    6855${tab}extend_existing=False,) 
    6956#end 
Note: See TracChangeset for help on using the changeset viewer.