Changeset 8411
- Timestamp:
- 26/06/12 21:44:46 (9 years ago)
- 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 205 205 206 206 TableModel parent = processUMLclass(cm); 207 String relName = parent.getAssociatedClass().getName().toLowerCase();207 String relName = "_" + parent.getAssociatedClass().getName().toLowerCase(); 208 208 Relationship rl = new Relationship(child, parent, relName, false, false); 209 209 ForeignKey fk = new ForeignKey(child, relName); -
mauRepo/xmi2sqlalchemy/trunk/src/main/resources/velocity/python/sqlAlchemyTables.vm
r8393 r8411 4 4 ## tableModel - an instance of ClassModel class 5 5 ########################################################################## 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)}#end12 ##end13 6 #macro(checkUseAlter $fk, $fkName, $relName) 14 7 , use_alter=True, name='fk_${fkName}_${relName}'#end … … 27 20 #set ($tn = ${tableModel.associatedClass.name.toLowerCase()}) 28 21 ${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')),#end33 ##end34 22 #end 35 23 … … 65 53 #column($attribute) 66 54 #end 67 ##${tab}#superColumn($tableModel)68 55 ${tab}extend_existing=False,) 69 56 #end
Note: See TracChangeset
for help on using the changeset viewer.