Package org.objectweb.jorm.mapper.rdb.lib

Examples of org.objectweb.jorm.mapper.rdb.lib.PMapperRdb


  /**
   * Write the sequences sql statements to add to the script.
   */
  private void writeSequencesStatements() throws IOException {
    if (!sequences.isEmpty()) {
      PMapperRdb mapper = (PMapperRdb) msm.getPMapper();
      msm.getFileWriter().write("----------- SEQUENCES ---------\n");
      for (Iterator it = sequences.iterator(); it.hasNext();) {
        SpeedoSequence s = (SpeedoSequence) it.next();
        log("[DEBUG] Sequence " + s.datastoreName, Project.MSG_DEBUG);
        //just write the sql sequences
        if (s.datastoreName != null && s.datastoreName != "") {
          if (isGenerateDrop()) {
            msm.getFileWriter().write(
              mapper.getRdbAdapter().getDropSequence(s.datastoreName+ "\n");
          }
          if (isGenerateCreate()) {
            msm.getFileWriter().write(
              mapper.getRdbAdapter().getCreateSequence(s.datastoreName, s.start, s.increment, s.cache)
              + "\n")
          }
        }
      }
    }
View Full Code Here


  /**
   * Write the indexes sql statements to add to the script.
   */
  private void writeIndexesStatements() throws IOException {
    if (!indexes.isEmpty()) {
      PMapperRdb mapper = (PMapperRdb) msm.getPMapper();
      msm.getFileWriter().write("----------- INDEXES ---------\n");
      for (Iterator it = indexes.iterator(); it.hasNext();) {
        SpeedoIndex si = (SpeedoIndex) it.next();
        log("[DEBUG] SpeedoIndex " + si.name, Project.MSG_DEBUG);
        if (isGenerateDrop()) {
          msm.getFileWriter().write(
            mapper.getRdbAdapter().getDropIndex(si.name, si.table) + "\n")
        }
        if (isGenerateCreate()) {
          if (si.columnNames != null && si.columnNames.size() != 0) {
            msm.getFileWriter().write(
                mapper.getRdbAdapter().getCreateIndex(si.name, si.table, si.columnNames, si.unique)
                + "\n");
          } else {
            log("[INFO] Index " + si.name + " has not been processed.", Project.MSG_INFO);
          }
        }
View Full Code Here

TOP

Related Classes of org.objectweb.jorm.mapper.rdb.lib.PMapperRdb

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.