Package org.byteliberi.easydriver.generator.model

Examples of org.byteliberi.easydriver.generator.model.RelationModel


      final String fieldName = field.getFieldName();
      // Let's check if the field is simple or a reference to an external class
      if (fks.containsKey(fieldName)) {
        // It's a foreign key 
        final List<RelationModel> relModelList = this.tableInfo.findRelByFK(fieldName);       
        final RelationModel foundRelation = this.tableInfo.findRelationModelByFK(relModelList, fieldName);
       
        final String propertyClass = Utils.getCamelNameFirstCapital ( foundRelation.getOneTable() ) + "ObjectModel";       
        final String propertyName = Utils.getCamelName( foundRelation.getOneTable() );
       
        if (!usedTableNames.contains(propertyClass)) {
          usedTableNames.add(propertyClass);
         
          final String referredProperty = Utils.getCamelNameFirstCapital(foundRelation.getRfManyTable() );
         
          out.println(MessageFormat.format("\t\tfinal {0} {1} = model.get{2}();", propertyClass, propertyName, referredProperty));
          out.println(MessageFormat.format("\t\tif ( {0} == null ) '{'", propertyName));
         
          for (int i = 0; i < relModelList.size(); i++)
View Full Code Here


      final String fieldName = field.getFieldName();
      // Let's check if the field is simple or a reference to an external class
      if (fks.containsKey(fieldName)) {
        // It's a foreign key 
        final List<RelationModel> relModelList = this.tableInfo.findRelByFK(fieldName);       
        final RelationModel foundRelation = this.tableInfo.findRelationModelByFK(relModelList, fieldName);
       
        final String propertyClass = Utils.getCamelNameFirstCapital ( foundRelation.getOneTable() ) + "ObjectModel";       
        final String propertyName = Utils.getCamelName( foundRelation.getOneTable() );
               
        if (!usedTableNames.contains(propertyClass)) {
          usedTableNames.add(propertyClass);
         
          final String referredProperty = Utils.getCamelNameFirstCapital(foundRelation.getRfManyTable() );
         
          out.println(MessageFormat.format("\t\tfinal {0} {1} = model.get{2}();", propertyClass, propertyName, referredProperty));
          out.println(MessageFormat.format("\t\tif ( {0} == null ) '{'", propertyName));
         
          for (int i = 0; i < relModelList.size(); i++)
View Full Code Here

       
      final List<RelationModel> relationModelList = findRelByColumn(relations, columnName);
      if (relationModelList == null)
        fpa = new FieldInit( Utils.getCamelNameFirstCapital(columnName) );
      else {
        final RelationModel relationModel = relationModelList.iterator().next();
        final String referencedTable = relationModel.getOneTable() + "ObjectModel";
        final String localColumnName = relationModel.getRfManyTable();
        if (!usedExtTables.contains(referencedTable)) {
          final LinkedList<String> columns = new LinkedList<String>();
          for (RelationModel rm : relationModelList)
            columns.add( Utils.getCamelNameFirstCapitalrm.getRfManyTable() ));         
         
View Full Code Here

TOP

Related Classes of org.byteliberi.easydriver.generator.model.RelationModel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.