Changeset 8028


Ignore:
Timestamp:
20/12/11 21:16:28 (8 years ago)
Author:
mnagni
Message:

Minimal difference with rev 8013

Location:
mauRepo/xmi2sqlalchemy/trunk/src/main/java/ndg/services/newmoon
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • mauRepo/xmi2sqlalchemy/trunk/src/main/java/ndg/services/newmoon/collect/ClassModel.java

    r8009 r8028  
    4848public class ClassModel implements ExportModel { 
    4949        public enum STEREOTYPE { 
    50                 Enumeration, CodeList, Union, DataType, Boolean, None, Metaclass; 
     50                Enumeration, CodeList, Union, DataType, Boolean, None, Metaclass, Type; 
    5151        } 
    5252        private final UMLClass associatedClass; 
  • mauRepo/xmi2sqlalchemy/trunk/src/main/java/ndg/services/newmoon/collect/CollectClassesClosure.java

    r8017 r8028  
    110110                        return STEREOTYPE.Metaclass; 
    111111                 
     112                if (stereotype.getName().equalsIgnoreCase(STEREOTYPE.Type.name())) 
     113                        return STEREOTYPE.Type; 
    112114                return STEREOTYPE.None; 
    113115        } 
  • mauRepo/xmi2sqlalchemy/trunk/src/main/java/ndg/services/newmoon/velocity/python/support/ForeignKey.java

    r7996 r8028  
    4040        private final String parentAttributeName; 
    4141        private boolean useAlter = false; 
    42  
     42        private Relationship associatedRelationship; 
     43         
    4344        /** 
    4445         * @param tableModel 
     
    4950                this.parentAttributeName = parentAttributeName; 
    5051        }                
     52         
     53        /** 
     54         * @return the associatedRelationship 
     55         */ 
     56        public Relationship getAssociatedRelationship() { 
     57                return associatedRelationship; 
     58        } 
     59 
     60 
     61 
     62        /** 
     63         * @param associatedRelationship the associatedRelationship to set 
     64         */ 
     65        public void setAssociatedRelationship(Relationship associatedRelationship) { 
     66                this.associatedRelationship = associatedRelationship; 
     67        } 
     68 
     69 
    5170 
    5271        /** 
  • mauRepo/xmi2sqlalchemy/trunk/src/main/java/ndg/services/newmoon/velocity/python/support/Relationship.java

    r8013 r8028  
    4545        private RELATION_TYPE relationType = null; 
    4646        private String backrefName = null; 
    47         //If true indicates that even if the relationType is MANY-to-MANY 
    48         //the relation is a ONE-to-ONE relation. 
    49         private final boolean doNotUseList; 
     47        private boolean useList; 
     48        private ForeignKey associatedForeignKey; 
    5049         
    5150        /** 
     
    5554         * @param nullable 
    5655         */ 
    57         public Relationship(TableModel fromTable, TableModel toTable, String name, boolean nullable, boolean doNotUseList) { 
     56        public Relationship(TableModel fromTable, TableModel toTable, String name, boolean nullable, boolean useList) { 
    5857                super(); 
    5958                this.fromTable = fromTable;              
    6059                this.toTable = toTable; 
    6160                this.name = name; 
    62                 this.nullable = nullable; 
    63                 this.doNotUseList = doNotUseList;                
    64         } 
    65          
    66         /** 
    67          * @return the doNotUseList 
    68          */ 
    69         public boolean isDoNotUseList() { 
    70                 return doNotUseList; 
    71         } 
    72  
    73  
     61                this.nullable = nullable;                
     62                this.useList = useList; 
     63        } 
     64         
     65        /** 
     66         * @return the associatedForeignKey 
     67         */ 
     68        public ForeignKey getAssociatedForeignKey() { 
     69                return associatedForeignKey; 
     70        } 
     71 
     72        /** 
     73         * @param associatedForeignKey the associatedForeignKey to set 
     74         */ 
     75        public void setAssociatedForeignKey(ForeignKey associatedForeignKey) { 
     76                this.associatedForeignKey = associatedForeignKey; 
     77        } 
     78 
     79        /** 
     80         * @return the useList 
     81         */ 
     82        public boolean isUseList() { 
     83                return useList; 
     84        } 
     85 
     86        /** 
     87         * Sets the useList attribute. For topological reason some time is necessary 
     88         *  to set up a MANY-to-MANY relation between a two tables even if the  
     89         *  linking attribute has a multiplicity equal to 1. This parameter 
     90         *  guarantees that even the relation is a MANY-to-MANY the ORM is aware  
     91         *  that the relation expects just zero or one result.  
     92         * @param useList the useList to set 
     93         */ 
     94        public void setUseList(boolean useList) { 
     95                this.useList = useList; 
     96        } 
    7497 
    7598        public boolean isManyToMany() { 
Note: See TracChangeset for help on using the changeset viewer.