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

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


  public List<ForeignKey> getForeignKeyList() {
      if (foreignKeys == null) {
        foreignKeys = new ArrayList<ForeignKey>();
        for (int i = 0; i < table.getForeignKeyCount(); i++) {
          ForeignKey foreignKey = new ForeignKeyDDLUtils (table.getForeignKey(i));
          foreignKeys.add(foreignKey);
        }
      }
      return foreignKeys;
  }
View Full Code Here


 
    protected Reference [] getParentsWithLocalForeignKey() {
      if (parents == null) {
        parents = new ArrayList<Reference>();
        for (int i = 0; i < getForeignKeys().length; i++) {
          ForeignKey foreignKey = getForeignKeys()[i];
//          Reference reference = foreignKey.getFirstReference();
//          //reverse reference view: reference comes from enrichment
//          Reference ref = new ReferenceDDLUtils (new org.apache.ddlutils.model.Reference());
//          ref.setForeignColumn(reference.getLocalColumn());
//          ref.setForeignColumnName(reference.getLocalColumnName());
//          ref.setForeignTable(reference.getLocalTable());
//          ref.setForeignTableName(reference.getLocalTableName());
//          ref.setLocalColumn(reference.getForeignColumn());
//          ref.setLocalColumnName(reference.getForeignColumnName());
//          ref.setLocalTable(reference.getForeignTable());
//          ref.setLocalTableName(reference.getForeignTableName());
          Reference ref = ReferenceDDLUtils.clone(foreignKey.getFirstReference());

//          ref.setForeignColumn(reference.getForeignColumn());
//          ref.setForeignColumnName(reference.getForeignColumnName());
//          ref.setForeignTable(reference.getForeignTable());
//          ref.setForeignTableName(reference.getForeignTableName());
View Full Code Here

  private static Logger logger = Logger.getLogger(ForeignKeyUtils.class);

  public static void setForeignKey (Table table, Field field) {
    //field.getEntity().getEnrichment().getBusinessModel().getModel().getDataModel().getDatabase();
    ForeignKey foreignKey = getForeignKey(field, table.getDatabase());
    if (foreignKey!=null)
      table.setForeignKey (foreignKey);   
  }
View Full Code Here

    if (field.getLinkToTargetEntity()!=null && field.getLinkToTargetField()!=null) {
      Reference reference = ReferenceUtils.getReference(field, database);
      if (reference!=null) {
        org.apache.ddlutils.model.ForeignKey foreignKeyMp = new org.apache.ddlutils.model.ForeignKey();
        foreignKeyMp.setName(field.getName());
        ForeignKey foreignKey = new ForeignKeyDDLUtils (foreignKeyMp);
        foreignKey.setForeignTableName(field.getLinkToTargetEntity());
        foreignKey.setReference (reference);
        // bidirection
        if (field.getBidirectional()!=null && field.getBidirectional().equals("false"))
          foreignKey.setBidirectional(false);
        return foreignKey;
      }
      logger.info("no correct fk found for "+field.getEntity().getName()+" - "+field.getName()+" - pointing towards "+field.getLinkToTargetEntity()+" - "+field.getLinkToTargetField());
    }
    return null;
View Full Code Here

TOP

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

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.