Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Commit [r832] Maximize Restore History

sfatehi 2009-03-06

added /schemacrawler/src/main/java/schemacrawler/schema/IndexColumn.java
changed /schemacrawler-tools/src/main/java/schemacrawler/tools/schematext/SchemaTextFormatter.java
changed /schemacrawler-tools/src/test/resources/maximum_schema.csv
changed /schemacrawler-tools/src/test/resources/maximum_schema.html
changed /schemacrawler-tools/src/test/resources/maximum_schema.other
changed /schemacrawler-tools/src/test/resources/maximum_schema.text
changed /schemacrawler/src/main/java/schemacrawler/crawl/MutableColumn.java
changed /schemacrawler/src/main/java/schemacrawler/crawl/MutableIndex.java
changed /schemacrawler/src/main/java/schemacrawler/crawl/MutablePrimaryKey.java
changed /schemacrawler/src/main/java/schemacrawler/crawl/TableRetriever.java
changed /schemacrawler/src/main/java/schemacrawler/schema/Index.java
copied /schemacrawler/src/main/java/schemacrawler/schema/IndexSortSequence.java -> /schemacrawler/src/main/java/schemacrawler/schema/IndexColumnSortSequence.java
copied /schemacrawler/src/main/java/schemacrawler/schema/IndexSortSequence.java -> /schemacrawler/src/main/java/schemacrawler/crawl/MutableIndexColumn.java
/schemacrawler/src/main/java/schemacrawler/schema/IndexColumn.java Diff Switch to side-by-side view
Loading...
/schemacrawler-tools/src/main/java/schemacrawler/tools/schematext/SchemaTextFormatter.java Diff Switch to side-by-side view
Loading...
/schemacrawler-tools/src/test/resources/maximum_schema.csv Diff Switch to side-by-side view
Loading...
/schemacrawler-tools/src/test/resources/maximum_schema.html Diff Switch to side-by-side view
Loading...
/schemacrawler-tools/src/test/resources/maximum_schema.other Diff Switch to side-by-side view
Loading...
/schemacrawler-tools/src/test/resources/maximum_schema.text Diff Switch to side-by-side view
Loading...
/schemacrawler/src/main/java/schemacrawler/crawl/MutableColumn.java Diff Switch to side-by-side view
Loading...
/schemacrawler/src/main/java/schemacrawler/crawl/MutableIndex.java Diff Switch to side-by-side view
Loading...
/schemacrawler/src/main/java/schemacrawler/crawl/MutablePrimaryKey.java Diff Switch to side-by-side view
Loading...
/schemacrawler/src/main/java/schemacrawler/crawl/TableRetriever.java Diff Switch to side-by-side view
Loading...
/schemacrawler/src/main/java/schemacrawler/schema/Index.java Diff Switch to side-by-side view
Loading...
/schemacrawler/src/main/java/schemacrawler/schema/IndexSortSequence.java to /schemacrawler/src/main/java/schemacrawler/crawl/MutableIndexColumn.java
--- a/schemacrawler/src/main/java/schemacrawler/schema/IndexSortSequence.java
+++ b/schemacrawler/src/main/java/schemacrawler/crawl/MutableIndexColumn.java
@@ -1,80 +1,51 @@
-/* 
- *
- * SchemaCrawler
- * http://sourceforge.net/projects/schemacrawler
- * Copyright (c) 2000-2009, Sualeh Fatehi.
- *
- * This library is free software; you can redistribute it and/or modify it under the terms
- * of the GNU Lesser General Public License as published by the Free Software Foundation;
- * either version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License along with this
- * library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-package schemacrawler.schema;
+package schemacrawler.crawl;
 
 
-import java.util.logging.Level;
-import java.util.logging.Logger;
+import schemacrawler.schema.Column;
+import schemacrawler.schema.Index;
+import schemacrawler.schema.IndexColumn;
+import schemacrawler.schema.IndexColumnSortSequence;
 
-/**
- * An enumeration wrapper around index sort sequences.
- */
-public enum IndexSortSequence
+final class MutableIndexColumn
+  extends MutableColumn
+  implements IndexColumn
 {
 
-  /** Unknown */
-  unknown("unknown"),
-  /** Ascending. */
-  ascending("A"),
-  /** Descending. */
-  descending("D");
+  private static final long serialVersionUID = -6923211341742623556L;
 
-  private static final Logger LOGGER = Logger.getLogger(IndexSortSequence.class
-    .getName());
+  private final Index index;
+  private IndexColumnSortSequence sortSequence;
 
-  /**
-   * Find the enumeration value corresponding to the string.
-   * 
-   * @param code
-   *        Sort sequence code.
-   * @return Enumeration value
-   */
-  public static IndexSortSequence valueOfFromCode(final String code)
+  public IndexColumnSortSequence getSortSequence()
   {
-    for (final IndexSortSequence type: IndexSortSequence.values())
-    {
-      if (type.getCode().equalsIgnoreCase(code))
-      {
-        return type;
-      }
-    }
-    LOGGER.log(Level.FINE, "Unknown code  " + code);
-    return unknown;
+    return sortSequence;
   }
 
-  private final String code;
-
-  private IndexSortSequence(final String code)
+  public MutableIndexColumn(Index index, Column column)
   {
-    this.code = code;
+    super(column.getParent(), column.getName());
+    this.index = index;
+    // 
+    setDefaultValue(column.getDefaultValue());
+    setPartOfPrimaryKey(column.isPartOfPrimaryKey());
+    setPartOfUniqueIndex(column.isPartOfUniqueIndex());
+    setReferencedColumn((MutableColumn) column.getReferencedColumn());
+    //
+    setDecimalDigits(column.getDecimalDigits());
+    setNullable(column.isNullable());
+    setOrdinalPosition(column.getOrdinalPosition());
+    setSize(column.getSize());
+    setType(column.getType());
   }
 
-  /**
-   * Index sort sequence code.
-   * 
-   * @return Index sort sequence code
-   */
-  public String getCode()
+  public void setSortSequence(IndexColumnSortSequence sortSequence)
   {
-    return code;
+    this.sortSequence = sortSequence;
+  }
+
+  public Index getIndex()
+  {
+    return index;
   }
 
 }