Package net.sf.minuteProject.configuration.bean.model.data

Examples of net.sf.minuteProject.configuration.bean.model.data.Table


          error = false;
          org.apache.ddlutils.model.ForeignKey foreignKeyddlutils = table.getForeignKeys()[i];
          org.apache.ddlutils.model.Reference referenceddlutils = foreignKeyddlutils.getFirstReference();
        Reference reference = new ReferenceDDLUtils (referenceddlutils);

        Table foreignTable = TableUtils.getTable(database,foreignKeyddlutils.getForeignTableName());
        Column foreignCol = new ColumnDDLUtils(referenceddlutils.getForeignColumn(),foreignTable);
        foreignCol.setAlias(ReferenceUtils.getColumnAlias(foreignTable, foreignCol));
        reference.setForeignColumn(foreignCol);
        reference.setForeignColumnName(referenceddlutils.getForeignColumnName());
        reference.setForeignTable(foreignTable);
        reference.setForeignTableName(foreignKeyddlutils.getForeignTableName());
        Column localCol = new ColumnDDLUtils(referenceddlutils.getLocalColumn(), this);
        reference.setLocalColumn(localCol);
        Table localTable = new TableDDLUtils(table);
        reference.setLocalTable(localTable);
        localCol.setAlias(ReferenceUtils.getColumnAlias(localTable, localCol));
        if (reference.getForeignColumnName()==null) {
          System.out.println ("error in ref : no column on "+table.getName()+" - "+reference.getLocalColumnName());
          error = true;
View Full Code Here


          tables.add(table);
        }*/
        org.apache.ddlutils.model.Table tablez[] = database.getTables();
        for (int i = 0; i < tablez.length; i++) {
          if (tablez[i].getType().equals("TABLE")) {
              Table table = new TableDDLUtils (tablez[i]);
              tables.add(table);
          }
        }
      }
      return (Table[])tables.toArray(new Table[tables.size()]);
View Full Code Here

    org.apache.ddlutils.model.Table table = new org.apache.ddlutils.model.Table();
    table.setName(getName());
    table.setCatalog(catalog);
    table.setType(Table.TABLE);
    addColumn (table, dir);
    Table entity = new TableDDLUtils(table);
    entity.setPackage(getPackage());
    entity.setDatabase(database);
    return entity;
  }
View Full Code Here

import net.sf.minuteProject.utils.FormatUtils;

public class FitnesseUtils {

  public static String getRenderingEntityPackageName(Template template, GeneratorBean bean) {
    Table table = (Table)bean;
    return FormatUtils.firstUpperCase(table.getDatabase().getDataModel().getModel().getName())+"FitnesseWiki"+getAppender(template);
  }
View Full Code Here

    processParentEntities (table, model);
  }
 
  private void processChildEntities(Table table, BusinessModel model) {
    for (Reference reference : table.getChildren()){
      Table t =TableUtils.getTable(model.getModel().getDataModel().getDatabase(), reference.getForeignTableName());
      for (Reference r : t.getParents()) {
        if (r.getForeignTableName().equals(table.getName()))
          r=null;
      }
      for (Reference r : t.getChildren()) {
        if (r.getForeignTableName().equals(table.getName()))
          r=null;
      }     
      reference = null;
    }
View Full Code Here

  void setPackages(Model model, Database database) {
//    packages = new ArrayList<Package>();
    Hashtable<String, Package> ht = new Hashtable<String, Package>();
    Table[] tables = database.getTables();
    for (int i = 0; i < tables.length; i++) {
      Table table = tables[i];
      table.setDatabase(database);
      store (ht, model, table);
//      if (ModelUtils.isToGenerate(businessModel, table)) {
//        String packageName = CommonUtils.getBusinessPackageName(model, table);
//        Package pack = (Package) ht.get(packageName);
//        if (pack == null) {
View Full Code Here

  public void setMasterRelationshipField(String masterRelationshipField) {
    this.masterRelationshipField = masterRelationshipField;
  }

  public Table getTable (Database database) {
    Table table = new TableDDLUtils(getTable(this, database));
    for (Action action : this.getActions()) {
      action.setParent(table);
    }
    table.setActions (this.getActions());
    table.setFieldGroups(this.getFieldGroups());
    return table;
  }
View Full Code Here

    foreignKey.setForeignTableName(field.getLinkToTargetEntity());
    return foreignKey;
  }

  private org.apache.ddlutils.model.Table getForeignTable(Field field, Database database) {
    Table table = TableUtils.getTable(database, field.getLinkToTargetEntity());
    org.apache.ddlutils.model.Table t = new org.apache.ddlutils.model.Table();
    t.setName(table.getName());
    return null;
  }
View Full Code Here

    return list;
  }

  private boolean isSelfReferencePrimaryKey(Column column) {
    if (column.isPrimaryKey()) {
      Table target = getTarget(column);
      if (target!=null &&
         target.getName().toLowerCase().equals(column.getTable().getName().toLowerCase()))
        return true;
    }
    return false;
  }
View Full Code Here

    return false;
  }

 
  private Table getTarget(Column column) {
    Table table = column.getTable();
    String tablename = getTargetEntityNameLowerCase(column);
    Table target = TableUtils.getTable(table.getDatabase(), tablename);
    if (target == null) {
      target = TableUtils.getTableFromAlias(table.getDatabase(), tablename);
    }
    return target;
  }
View Full Code Here

TOP

Related Classes of net.sf.minuteProject.configuration.bean.model.data.Table

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.