Package net.sf.minuteProject.configuration.bean.strategy.datamodel

Examples of net.sf.minuteProject.configuration.bean.strategy.datamodel.PrimaryKeyPolicyPattern


    } else
    return "ERROR_ON_LOOK_UP for PK";
  }
 
  public String provideSequence (Model model) {
    PrimaryKeyPolicyPattern primaryKeyPolicyPattern = getPrimaryKeyPolicyPattern(model);
    return provideSequenceOneGlobal(primaryKeyPolicyPattern);
  }
View Full Code Here


  public static String provideSequence (Table table) {
    PrimaryKeyPolicy primaryKeyPolicy = table.getDatabase().getDataModel().getPrimaryKeyPolicy();
    if (primaryKeyPolicy==null) {
      return "NO LOOK UP for PK";
    }
    PrimaryKeyPolicyPattern primaryKeyPolicyPattern = primaryKeyPolicy.getFirstPrimaryKeyPolicyPattern();
    if (primaryKeyPolicyPattern==null) {
      return "NO LOOK UP for PK : no pattern found";
    }
    if (primaryKeyPolicy.isOneGlobal()) {
      return provideSequenceOneGlobal(primaryKeyPolicyPattern);
    } else if (primaryKeyPolicy.isOneForEachTable()){
      String seq = initSequence(primaryKeyPolicyPattern, table);
      if (primaryKeyPolicyPattern.getPrefix()!=null || primaryKeyPolicyPattern.getSuffix()!=null) {
        if (primaryKeyPolicyPattern.getPrefix()!=null)
          seq = primaryKeyPolicyPattern.getPrefix() + seq;
        if (primaryKeyPolicyPattern.getSuffix()!=null)
            seq = seq+primaryKeyPolicyPattern.getSuffix();
        return seq;
      } else
        return seq + "_SEQ";
    }
    else
View Full Code Here

    PrimaryKeyPolicy primaryKeyPolicy = getPrimaryKeyPolicy(table);
    return  getPrimaryKeyPolicyPattern(primaryKeyPolicy);
  }
 
  public PrimaryKeyPolicyPatternEnum getPrimaryKeyPolicyPatternEnum (Table table) {
    PrimaryKeyPolicyPattern primaryKeyPolicyPattern = getPrimaryKeyPolicyPattern (table);
    if (primaryKeyPolicyPattern != null) {
      return primaryKeyPolicyPattern.getPrimaryKeyPolicyPatternEnum();
    }
    return PrimaryKeyPolicyPatternEnum.OTHER;
  }
View Full Code Here

    }
    return false;
  }

  private PrimaryKeyPolicyPattern getPrimaryKeyPolicyPattern() {
    PrimaryKeyPolicyPattern primaryKeyPolicyPattern = new PrimaryKeyPolicyPattern();
    if (primaryKeyPolicy.equals(PrimaryKeyPolicyPatternEnum.SEQUENCE)) {
      primaryKeyPolicyPattern.setName(PrimaryKeyPolicyPattern.SEQUENCE);
      if (sequencePattern.equals("global sequence")) {
        primaryKeyPolicyPattern.setSequenceName(getSequenceGlobalName());   
      } else {
        primaryKeyPolicyPattern.setSuffix(getSequenceEntitySuffix());
      }
    }
    else if (primaryKeyPolicy.equals("autoincrement"))
      primaryKeyPolicyPattern.setName(PrimaryKeyPolicyPattern.AUTOINCREMENT);
    return primaryKeyPolicyPattern;
  }
View Full Code Here

TOP

Related Classes of net.sf.minuteProject.configuration.bean.strategy.datamodel.PrimaryKeyPolicyPattern

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.