You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@metamodel.apache.org by ka...@apache.org on 2013/07/22 10:10:43 UTC
[30/64] [partial] Hard rename of all 'org/eobjects' folders to
'org/apache'.
http://git-wip-us.apache.org/repos/asf/incubator-metamodel/blob/e2e2b37a/core/src/main/java/org/eobjects/metamodel/schema/ColumnType.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/eobjects/metamodel/schema/ColumnType.java b/core/src/main/java/org/eobjects/metamodel/schema/ColumnType.java
deleted file mode 100644
index ea938e6..0000000
--- a/core/src/main/java/org/eobjects/metamodel/schema/ColumnType.java
+++ /dev/null
@@ -1,292 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.eobjects.metamodel.schema;
-
-import static org.eobjects.metamodel.schema.SuperColumnType.BINARY_TYPE;
-import static org.eobjects.metamodel.schema.SuperColumnType.BOOLEAN_TYPE;
-import static org.eobjects.metamodel.schema.SuperColumnType.LITERAL_TYPE;
-import static org.eobjects.metamodel.schema.SuperColumnType.NUMBER_TYPE;
-import static org.eobjects.metamodel.schema.SuperColumnType.OTHER_TYPE;
-import static org.eobjects.metamodel.schema.SuperColumnType.TIME_TYPE;
-
-import java.lang.reflect.Field;
-import java.math.BigDecimal;
-import java.math.BigInteger;
-import java.sql.Blob;
-import java.sql.Clob;
-import java.sql.Time;
-import java.sql.Timestamp;
-import java.sql.Types;
-import java.util.Comparator;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-
-import org.eobjects.metamodel.util.NumberComparator;
-import org.eobjects.metamodel.util.ObjectComparator;
-import org.eobjects.metamodel.util.TimeComparator;
-import org.eobjects.metamodel.util.ToStringComparator;
-
-/**
- * Represents the data-type of columns. Most of the elements in this enum are
- * based on the JDBC {@link Types} class, but with a few additions.
- */
-public enum ColumnType {
-
- /**
- * Literal
- */
- CHAR(LITERAL_TYPE), VARCHAR(LITERAL_TYPE), LONGVARCHAR(LITERAL_TYPE), CLOB(LITERAL_TYPE), NCHAR(LITERAL_TYPE), NVARCHAR(
- LITERAL_TYPE), LONGNVARCHAR(LITERAL_TYPE), NCLOB(LITERAL_TYPE),
-
- /**
- * Numbers
- */
- TINYINT(NUMBER_TYPE), SMALLINT(NUMBER_TYPE), INTEGER(NUMBER_TYPE), BIGINT(NUMBER_TYPE), FLOAT(NUMBER_TYPE), REAL(
- NUMBER_TYPE), DOUBLE(NUMBER_TYPE), NUMERIC(NUMBER_TYPE), DECIMAL(NUMBER_TYPE),
-
- /**
- * Time based
- */
- DATE(TIME_TYPE), TIME(TIME_TYPE), TIMESTAMP(TIME_TYPE),
-
- /**
- * Booleans
- */
- BIT(BOOLEAN_TYPE), BOOLEAN(BOOLEAN_TYPE),
-
- /**
- * Binary types
- */
- BINARY(BINARY_TYPE), VARBINARY(BINARY_TYPE), LONGVARBINARY(BINARY_TYPE), BLOB(BINARY_TYPE),
-
- /**
- * Other types (as defined in {@link Types}).
- */
- NULL(OTHER_TYPE), OTHER(OTHER_TYPE), JAVA_OBJECT(OTHER_TYPE), DISTINCT(OTHER_TYPE), STRUCT(OTHER_TYPE), ARRAY(
- OTHER_TYPE), REF(OTHER_TYPE), DATALINK(OTHER_TYPE), ROWID(OTHER_TYPE), SQLXML(OTHER_TYPE),
-
- /**
- * Additional types (added by MetaModel for non-JDBC datastores)
- */
- LIST(OTHER_TYPE), MAP(OTHER_TYPE);
-
- private SuperColumnType _superType;
-
- private ColumnType(SuperColumnType superType) {
- if (superType == null) {
- throw new IllegalArgumentException("SuperColumnType cannot be null");
- }
- _superType = superType;
- }
-
- public Comparator<Object> getComparator() {
- if (isTimeBased()) {
- return TimeComparator.getComparator();
- }
- if (isNumber()) {
- return NumberComparator.getComparator();
- }
- if (isLiteral()) {
- return ToStringComparator.getComparator();
- }
- return ObjectComparator.getComparator();
- }
-
- public boolean isBoolean() {
- return _superType == BOOLEAN_TYPE;
- }
-
- public boolean isBinary() {
- return _superType == BINARY_TYPE;
- }
-
- public boolean isNumber() {
- return _superType == NUMBER_TYPE;
- }
-
- public boolean isTimeBased() {
- return _superType == TIME_TYPE;
- }
-
- public boolean isLiteral() {
- return _superType == LITERAL_TYPE;
- }
-
- public boolean isLargeObject() {
- switch (this) {
- case BLOB:
- case CLOB:
- case NCLOB:
- return true;
- default:
- return false;
- }
- }
-
- /**
- * @return a java class that is appropriate for handling column values of
- * this column type
- */
- public Class<?> getJavaEquivalentClass() {
- switch (this) {
- case TINYINT:
- case SMALLINT:
- return Short.class;
- case INTEGER:
- return Integer.class;
- case BIGINT:
- return BigInteger.class;
- case DECIMAL:
- case NUMERIC:
- case FLOAT:
- case REAL:
- case DOUBLE:
- return Double.class;
- case DATE:
- case TIME:
- case TIMESTAMP:
- return Date.class;
- case BLOB:
- return Blob.class;
- case CLOB:
- case NCLOB:
- return Clob.class;
- case MAP:
- return Map.class;
- case LIST:
- return List.class;
- default:
- // All other types have fitting java equivalent classes in the super
- // type
- return _superType.getJavaEquivalentClass();
- }
- }
-
- public SuperColumnType getSuperType() {
- return _superType;
- }
-
- /**
- * Finds the ColumnType enum corresponding to the incoming JDBC
- * type-constant
- */
- public static ColumnType convertColumnType(int jdbcType) {
- try {
- Field[] fields = JdbcTypes.class.getFields();
- // We assume that the JdbcTypes class only consists of constant
- // integer types, so we make no assertions here
- for (int i = 0; i < fields.length; i++) {
- Field field = fields[i];
- int value = (Integer) field.getInt(null);
- if (value == jdbcType) {
- String fieldName = field.getName();
- ColumnType[] enumConstants = ColumnType.class.getEnumConstants();
- for (int j = 0; j < enumConstants.length; j++) {
- ColumnType columnType = enumConstants[j];
- if (fieldName.equals(columnType.toString())) {
- return columnType;
- }
- }
- }
- }
- } catch (Exception e) {
- throw new IllegalStateException("Could not access fields in JdbcTypes", e);
- }
- return OTHER;
- }
-
- /**
- * Gets the JDBC type as per the {@link Types} class.
- *
- * @return an int representing one of the constants in the {@link Types}
- * class.
- * @throws IllegalStateException
- * in case getting the JDBC type was unsuccesful.
- */
- public int getJdbcType() throws IllegalStateException {
- final String name = this.toString();
- try {
- // We assume that the JdbcTypes class only consists of constant
- // integer types, so we make no assertions here
- final Field[] fields = JdbcTypes.class.getFields();
- for (int i = 0; i < fields.length; i++) {
- Field field = fields[i];
- String fieldName = field.getName();
- if (fieldName.equals(name)) {
- int value = (Integer) field.getInt(null);
- return value;
- }
- }
- throw new IllegalStateException("No JdbcType found with field name: " + name);
- } catch (Exception e) {
- throw new IllegalStateException("Could not access fields in JdbcTypes", e);
- }
- }
-
- /**
- * Finds the ColumnType enum corresponding to the incoming Java class.
- *
- * @param cls
- * @return
- */
- public static ColumnType convertColumnType(Class<?> cls) {
- if (cls == null) {
- throw new IllegalArgumentException("Class cannot be null");
- }
-
- final ColumnType type;
- if (cls == String.class) {
- type = ColumnType.VARCHAR;
- } else if (cls == Boolean.class || cls == boolean.class) {
- type = ColumnType.BOOLEAN;
- } else if (cls == Character.class || cls == char.class || cls == Character[].class || cls == char[].class) {
- type = ColumnType.CHAR;
- } else if (cls == Byte.class || cls == byte.class) {
- type = ColumnType.TINYINT;
- } else if (cls == Short.class || cls == short.class) {
- type = ColumnType.SMALLINT;
- } else if (cls == Integer.class || cls == int.class) {
- type = ColumnType.INTEGER;
- } else if (cls == Long.class || cls == long.class || cls == BigInteger.class) {
- type = ColumnType.BIGINT;
- } else if (cls == Float.class || cls == float.class) {
- type = ColumnType.FLOAT;
- } else if (cls == Double.class || cls == double.class) {
- type = ColumnType.DOUBLE;
- } else if (cls == BigDecimal.class) {
- type = ColumnType.DECIMAL;
- } else if (Map.class.isAssignableFrom(cls)) {
- type = ColumnType.MAP;
- } else if (List.class.isAssignableFrom(cls)) {
- type = ColumnType.LIST;
- } else if (cls == java.sql.Date.class) {
- type = ColumnType.DATE;
- } else if (cls == Timestamp.class) {
- type = ColumnType.TIMESTAMP;
- } else if (cls == Time.class) {
- type = ColumnType.TIME;
- } else if (Date.class.isAssignableFrom(cls)) {
- type = ColumnType.TIMESTAMP;
- } else {
- type = ColumnType.OTHER;
- }
- return type;
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-metamodel/blob/e2e2b37a/core/src/main/java/org/eobjects/metamodel/schema/CompositeSchema.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/eobjects/metamodel/schema/CompositeSchema.java b/core/src/main/java/org/eobjects/metamodel/schema/CompositeSchema.java
deleted file mode 100644
index f4f75e1..0000000
--- a/core/src/main/java/org/eobjects/metamodel/schema/CompositeSchema.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.eobjects.metamodel.schema;
-
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Set;
-
-import org.eobjects.metamodel.DataContext;
-import org.eobjects.metamodel.util.CollectionUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * A composite schema, comprising tables from several {@link DataContext}s.
- *
- * @author Kasper Sørensen
- */
-public class CompositeSchema extends AbstractSchema {
-
- private static final long serialVersionUID = 1L;
-
- private static final Logger logger = LoggerFactory.getLogger(CompositeSchema.class);
-
- private final String name;
- private final Collection<? extends Schema> delegates;
-
- public CompositeSchema(String name, Collection<? extends Schema> delegates) {
- super();
- this.name = name;
- this.delegates = delegates;
- if (logger.isWarnEnabled()) {
- Set<String> names = new HashSet<String>();
- for (Table table : getTables()) {
- if (names.contains(table.getName())) {
- logger.warn("Name-clash detected for Table {}.", table.getName());
- logger.warn("getTableByName(\"{}\") will return just the first table.", table.getName());
- } else {
- names.add(table.getName());
- }
- }
- if (!names.isEmpty()) {
- logger.warn("The following table names clashes in composite schema: " + names);
- }
- }
- }
-
- @Override
- public Relationship[] getRelationships() {
- Relationship[] result = new Relationship[0];
- for (Schema delegate : delegates) {
- result = CollectionUtils.array(result, delegate.getRelationships());
- }
- return result;
- }
-
- @Override
- public Table[] getTables() {
- Table[] result = new Table[0];
- for (Schema delegate : delegates) {
- result = CollectionUtils.array(result, delegate.getTables());
- }
- return result;
- }
-
- @Override
- public String getName() {
- return name;
- }
-
- @Override
- public String getQuote() {
- return null;
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-metamodel/blob/e2e2b37a/core/src/main/java/org/eobjects/metamodel/schema/ImmutableColumn.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/eobjects/metamodel/schema/ImmutableColumn.java b/core/src/main/java/org/eobjects/metamodel/schema/ImmutableColumn.java
deleted file mode 100644
index 3236c00..0000000
--- a/core/src/main/java/org/eobjects/metamodel/schema/ImmutableColumn.java
+++ /dev/null
@@ -1,173 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.eobjects.metamodel.schema;
-
-import java.io.Serializable;
-
-/**
- * Immutable implementation of the Column interface.
- *
- * It is not intended to be instantiated on it's own. Rather, use the
- * constructor in ImmutableSchema.
- *
- * @see ImmutableSchema
- *
- * @author Kasper Sørensen
- */
-public final class ImmutableColumn extends AbstractColumn implements Serializable {
-
- private static final long serialVersionUID = 1L;
-
- private final int columnNumber;
- private final ColumnType type;
- private final Table table;
- private final Boolean nullable;
- private final String remarks;
- private final Integer columnSize;
- private final String nativeType;
- private final boolean indexed;
- private final boolean primaryKey;
- private final String name;
- private final String quote;
-
- /**
- * Constructs a new {@link ImmutableColumn}.
- *
- * @param name
- * the name of the column
- * @param type
- * the type of the column
- * @param table
- * the table which the constructed column will pertain to
- * @param columnNumber
- * the column number of the column
- * @param columnSize
- * the size of the column
- * @param nativeType
- * the native type of the column
- * @param nullable
- * whether the column's values are nullable
- * @param remarks
- * the remarks of the column
- * @param indexed
- * whether the column is indexed or not
- * @param quote
- * the quote character(s) of the column
- * @param primaryKey
- * whether the column is a primary key or not
- */
- public ImmutableColumn(String name, ColumnType type, Table table, int columnNumber, Integer columnSize,
- String nativeType, Boolean nullable, String remarks, boolean indexed, String quote, boolean primaryKey) {
- this.name = name;
- this.type = type;
- this.table = table;
- this.columnNumber = columnNumber;
- this.columnSize = columnSize;
- this.nativeType = nativeType;
- this.nullable = nullable;
- this.remarks = remarks;
- this.indexed = indexed;
- this.quote = quote;
- this.primaryKey = primaryKey;
- }
-
- /**
- * Constructs an {@link ImmutableColumn} based on an existing column and a
- * table.
- *
- * @param column
- * the column to immitate
- * @param table
- * the table that the constructed column will pertain to
- */
- public ImmutableColumn(Column column, Table table) {
- this.name = column.getName();
- this.type = column.getType();
- this.table = table;
- this.columnNumber = column.getColumnNumber();
- this.columnSize = column.getColumnSize();
- this.nativeType = column.getNativeType();
- this.nullable = column.isNullable();
- this.remarks = column.getRemarks();
- this.indexed = column.isIndexed();
- this.quote = column.getQuote();
- this.primaryKey = column.isPrimaryKey();
- }
-
- protected ImmutableColumn(Column column, ImmutableTable table) {
- this(column.getName(), column.getType(), table, column.getColumnNumber(), column.getColumnSize(), column
- .getNativeType(), column.isNullable(), column.getRemarks(), column.isIndexed(), column.getQuote(),
- column.isPrimaryKey());
- }
-
- @Override
- public int getColumnNumber() {
- return columnNumber;
- }
-
- @Override
- public ColumnType getType() {
- return type;
- }
-
- @Override
- public Table getTable() {
- return table;
- }
-
- @Override
- public Boolean isNullable() {
- return nullable;
- }
-
- @Override
- public String getRemarks() {
- return remarks;
- }
-
- @Override
- public Integer getColumnSize() {
- return columnSize;
- }
-
- @Override
- public String getNativeType() {
- return nativeType;
- }
-
- @Override
- public boolean isIndexed() {
- return indexed;
- }
-
- @Override
- public String getName() {
- return name;
- }
-
- @Override
- public boolean isPrimaryKey() {
- return primaryKey;
- }
-
- @Override
- public String getQuote() {
- return quote;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-metamodel/blob/e2e2b37a/core/src/main/java/org/eobjects/metamodel/schema/ImmutableRelationship.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/eobjects/metamodel/schema/ImmutableRelationship.java b/core/src/main/java/org/eobjects/metamodel/schema/ImmutableRelationship.java
deleted file mode 100644
index 43f2cf0..0000000
--- a/core/src/main/java/org/eobjects/metamodel/schema/ImmutableRelationship.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.eobjects.metamodel.schema;
-
-import java.io.Serializable;
-
-public final class ImmutableRelationship extends AbstractRelationship implements Serializable {
-
- private static final long serialVersionUID = 1L;
-
- private final Column[] primaryColumns;
- private final Column[] foreignColumns;
-
- public static void create(Relationship origRelationship,
- ImmutableSchema schema) {
- ImmutableTable primaryTable = getSimilarTable(
- origRelationship.getPrimaryTable(), schema);
- assert primaryTable != null;
- Column[] primaryColumns = getSimilarColumns(
- origRelationship.getPrimaryColumns(), primaryTable);
- checkSameTable(primaryColumns);
-
- ImmutableTable foreignTable = getSimilarTable(
- origRelationship.getForeignTable(), schema);
- assert foreignTable != null;
- Column[] foreignColumns = getSimilarColumns(
- origRelationship.getForeignColumns(), foreignTable);
- checkSameTable(foreignColumns);
-
- ImmutableRelationship relationship = new ImmutableRelationship(
- primaryColumns, foreignColumns);
- primaryTable.addRelationship(relationship);
- foreignTable.addRelationship(relationship);
- }
-
- private static Column[] getSimilarColumns(Column[] columns, Table table) {
- Column[] result = new Column[columns.length];
- for (int i = 0; i < columns.length; i++) {
- String name = columns[i].getName();
- result[i] = table.getColumnByName(name);
- }
- return result;
- }
-
- private static ImmutableTable getSimilarTable(Table table,
- ImmutableSchema schema) {
- String name = table.getName();
- return (ImmutableTable) schema.getTableByName(name);
- }
-
- private ImmutableRelationship(Column[] primaryColumns,
- Column[] foreignColumns) {
- this.primaryColumns = primaryColumns;
- this.foreignColumns = foreignColumns;
- }
-
- @Override
- public Column[] getPrimaryColumns() {
- return primaryColumns;
- }
-
- @Override
- public Column[] getForeignColumns() {
- return foreignColumns;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-metamodel/blob/e2e2b37a/core/src/main/java/org/eobjects/metamodel/schema/ImmutableSchema.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/eobjects/metamodel/schema/ImmutableSchema.java b/core/src/main/java/org/eobjects/metamodel/schema/ImmutableSchema.java
deleted file mode 100644
index 8ac8a79..0000000
--- a/core/src/main/java/org/eobjects/metamodel/schema/ImmutableSchema.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.eobjects.metamodel.schema;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * An immutable implementation of the {@link Schema} interface.
- *
- * @author Kasper Sørensen
- */
-public final class ImmutableSchema extends AbstractSchema implements
- Serializable {
-
- private static final long serialVersionUID = 1L;
-
- private final List<ImmutableTable> tables = new ArrayList<ImmutableTable>();
- private String name;
- private String quote;
-
- private ImmutableSchema(String name, String quote) {
- super();
- this.name = name;
- this.quote = quote;
- }
-
- public ImmutableSchema(Schema schema) {
- this(schema.getName(), schema.getQuote());
- Table[] origTables = schema.getTables();
- for (Table table : origTables) {
- tables.add(new ImmutableTable(table, this));
- }
-
- Relationship[] origRelationships = schema.getRelationships();
- for (Relationship relationship : origRelationships) {
- ImmutableRelationship.create(relationship, this);
- }
- }
-
- @Override
- public Table[] getTables() {
- return tables.toArray(new Table[tables.size()]);
- }
-
- @Override
- public String getName() {
- return name;
- }
-
- @Override
- public String getQuote() {
- return quote;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-metamodel/blob/e2e2b37a/core/src/main/java/org/eobjects/metamodel/schema/ImmutableTable.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/eobjects/metamodel/schema/ImmutableTable.java b/core/src/main/java/org/eobjects/metamodel/schema/ImmutableTable.java
deleted file mode 100644
index a4d6d81..0000000
--- a/core/src/main/java/org/eobjects/metamodel/schema/ImmutableTable.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.eobjects.metamodel.schema;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * An immutable implementation of the Table interface.
- *
- * It is not intended to be instantiated on it's own. Rather, use the
- * constructor in ImmutableSchema.
- *
- * @see ImmutableSchema
- *
- * @author Kasper Sørensen
- */
-final class ImmutableTable extends AbstractTable implements Serializable {
-
- private static final long serialVersionUID = 1L;
-
- private final List<ImmutableColumn> columns = new ArrayList<ImmutableColumn>();
- private final List<ImmutableRelationship> relationships = new ArrayList<ImmutableRelationship>();
- private final ImmutableSchema schema;
- private final TableType type;
- private final String remarks;
- private final String name;
- private final String quote;
-
- protected ImmutableTable(String name, TableType type, ImmutableSchema schema,
- String remarks, String quote) {
- this.name = name;
- this.type = type;
- this.schema = schema;
- this.remarks = remarks;
- this.quote = quote;
- }
-
- protected ImmutableTable(Table table, ImmutableSchema schema) {
- this(table.getName(), table.getType(), schema, table.getRemarks(),
- table.getQuote());
- Column[] origColumns = table.getColumns();
- for (Column column : origColumns) {
- columns.add(new ImmutableColumn(column, this));
- }
- }
-
- protected void addRelationship(ImmutableRelationship relationship) {
- if (!relationships.contains(relationship)) {
- relationships.add(relationship);
- }
- }
-
- @Override
- public Column[] getColumns() {
- return columns.toArray(new Column[columns.size()]);
- }
-
- @Override
- public Schema getSchema() {
- return schema;
- }
-
- @Override
- public TableType getType() {
- return type;
- }
-
- @Override
- public Relationship[] getRelationships() {
- return relationships.toArray(new Relationship[relationships.size()]);
- }
-
- @Override
- public String getRemarks() {
- return remarks;
- }
-
- @Override
- public String getName() {
- return name;
- }
-
- @Override
- public String getQuote() {
- return quote;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-metamodel/blob/e2e2b37a/core/src/main/java/org/eobjects/metamodel/schema/JdbcTypes.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/eobjects/metamodel/schema/JdbcTypes.java b/core/src/main/java/org/eobjects/metamodel/schema/JdbcTypes.java
deleted file mode 100644
index 4531921..0000000
--- a/core/src/main/java/org/eobjects/metamodel/schema/JdbcTypes.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.eobjects.metamodel.schema;
-
-/**
- * This is a copy of the content (comments removed) of Java 6.0's
- * java.sql.Types. It is backwards compatible with older versions, but have
- * additional types (confirmed by JavaTypesTest). It is being used to convert
- * JDBC types to ColumnType enumerations.
- */
-final class JdbcTypes {
-
- // Prevent instantiation
- private JdbcTypes() {
- }
-
- public final static int BIT = -7;
- public final static int TINYINT = -6;
- public final static int SMALLINT = 5;
- public final static int INTEGER = 4;
- public final static int BIGINT = -5;
- public final static int FLOAT = 6;
- public final static int REAL = 7;
- public final static int DOUBLE = 8;
- public final static int NUMERIC = 2;
- public final static int DECIMAL = 3;
- public final static int CHAR = 1;
- public final static int VARCHAR = 12;
- public final static int LONGVARCHAR = -1;
- public final static int DATE = 91;
- public final static int TIME = 92;
- public final static int TIMESTAMP = 93;
- public final static int BINARY = -2;
- public final static int VARBINARY = -3;
- public final static int LONGVARBINARY = -4;
- public final static int NULL = 0;
- public final static int OTHER = 1111;
- public final static int JAVA_OBJECT = 2000;
- public final static int DISTINCT = 2001;
- public final static int STRUCT = 2002;
- public final static int ARRAY = 2003;
- public final static int BLOB = 2004;
- public final static int CLOB = 2005;
- public final static int REF = 2006;
- public final static int DATALINK = 70;
- public final static int BOOLEAN = 16;
- public final static int ROWID = -8;
- public static final int NCHAR = -15;
- public static final int NVARCHAR = -9;
- public static final int LONGNVARCHAR = -16;
- public static final int NCLOB = 2011;
- public static final int SQLXML = 2009;
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-metamodel/blob/e2e2b37a/core/src/main/java/org/eobjects/metamodel/schema/MutableColumn.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/eobjects/metamodel/schema/MutableColumn.java b/core/src/main/java/org/eobjects/metamodel/schema/MutableColumn.java
deleted file mode 100644
index d4c464d..0000000
--- a/core/src/main/java/org/eobjects/metamodel/schema/MutableColumn.java
+++ /dev/null
@@ -1,185 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.eobjects.metamodel.schema;
-
-import java.io.Serializable;
-
-/**
- * Represents a column and it's metadata description. Columns reside within a
- * Table and can be used as keys for relationships between tables.
- *
- * @see MutableTable
- * @see Relationship
- */
-public class MutableColumn extends AbstractColumn implements Serializable {
-
- private static final long serialVersionUID = -353183696233890927L;
- private int _columnNumber;
- private String _name;
- private ColumnType _type;
- private Table _table;
- private Boolean _nullable = null;
- private String _remarks;
- private boolean _indexed = false;
- private boolean _primaryKey = false;
- private Integer _columnSize = null;
- private String _nativeType = null;
- private String _quoteString = null;
-
- public MutableColumn() {
- super();
- }
-
- public MutableColumn(String name) {
- this();
- setName(name);
- }
-
- public MutableColumn(String name, ColumnType type) {
- this(name);
- setType(type);
- }
-
- public MutableColumn(String name, ColumnType type, Table table, int columnNumber, Boolean nullable) {
- this(name, type);
- setColumnNumber(columnNumber);
- setTable(table);
- setNullable(nullable);
- }
-
- public MutableColumn(String name, ColumnType type, Table table, int columnNumber, Integer columnSize,
- String nativeType, Boolean nullable, String remarks, boolean indexed, String quote) {
- this(name, type, table, columnNumber, nullable);
- setColumnSize(columnSize);
- setNativeType(nativeType);
- setRemarks(remarks);
- setIndexed(indexed);
- setQuote(quote);
- }
-
- @Override
- public int getColumnNumber() {
- return _columnNumber;
- }
-
- public MutableColumn setColumnNumber(int columnNumber) {
- _columnNumber = columnNumber;
- return this;
- }
-
- @Override
- public String getName() {
- return _name;
- }
-
- public MutableColumn setName(String name) {
- _name = name;
- return this;
- }
-
- @Override
- public ColumnType getType() {
- return _type;
- }
-
- public MutableColumn setType(ColumnType type) {
- _type = type;
- return this;
- }
-
- @Override
- public Table getTable() {
- return _table;
- }
-
- public MutableColumn setTable(Table table) {
- _table = table;
- return this;
- }
-
- @Override
- public Boolean isNullable() {
- return _nullable;
- }
-
- public MutableColumn setNullable(Boolean nullable) {
- _nullable = nullable;
- return this;
- }
-
- @Override
- public String getRemarks() {
- return _remarks;
- }
-
- public MutableColumn setRemarks(String remarks) {
- _remarks = remarks;
- return this;
- }
-
- @Override
- public Integer getColumnSize() {
- return _columnSize;
- }
-
- public MutableColumn setColumnSize(Integer columnSize) {
- _columnSize = columnSize;
- return this;
- }
-
- @Override
- public String getNativeType() {
- return _nativeType;
- }
-
- public MutableColumn setNativeType(String nativeType) {
- _nativeType = nativeType;
- return this;
- }
-
- @Override
- public boolean isIndexed() {
- return _indexed;
- }
-
- public MutableColumn setIndexed(boolean indexed) {
- _indexed = indexed;
- return this;
- }
-
- @Override
- public String getQuote() {
- return _quoteString;
- }
-
- public MutableColumn setQuote(String quoteString) {
- _quoteString = quoteString;
- return this;
- }
-
- @Override
- public boolean isPrimaryKey() {
- return _primaryKey;
- }
-
- public MutableColumn setPrimaryKey(boolean primaryKey) {
- _primaryKey = primaryKey;
- return this;
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-metamodel/blob/e2e2b37a/core/src/main/java/org/eobjects/metamodel/schema/MutableRelationship.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/eobjects/metamodel/schema/MutableRelationship.java b/core/src/main/java/org/eobjects/metamodel/schema/MutableRelationship.java
deleted file mode 100644
index 8762222..0000000
--- a/core/src/main/java/org/eobjects/metamodel/schema/MutableRelationship.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.eobjects.metamodel.schema;
-
-import java.io.Serializable;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Immutable implementation of the Relationship interface.
- *
- * The immutability help ensure integrity of object-relationships. To create
- * relationsips use the <code>createRelationship</code> method.
- *
- * @author Kasper Sørensen
- */
-public class MutableRelationship extends AbstractRelationship implements
- Serializable, Relationship {
-
- private static final long serialVersionUID = 238786848828528822L;
- private static final Logger logger = LoggerFactory
- .getLogger(MutableRelationship.class);
-
- private final Column[] _primaryColumns;
- private final Column[] _foreignColumns;
-
- /**
- * Factory method to create relations between two tables by specifying which
- * columns from the tables that enforce the relationship.
- *
- * @param primaryColumns
- * the columns from the primary key table
- * @param foreignColumns
- * the columns from the foreign key table
- * @return the relation created
- */
- public static Relationship createRelationship(Column[] primaryColumns,
- Column[] foreignColumns) {
- Table primaryTable = checkSameTable(primaryColumns);
- Table foreignTable = checkSameTable(foreignColumns);
- MutableRelationship relation = new MutableRelationship(primaryColumns,
- foreignColumns);
-
- if (primaryTable instanceof MutableTable) {
- try {
- ((MutableTable) primaryTable).addRelationship(relation);
- } catch (UnsupportedOperationException e) {
- // this is an allowed behaviour - not all tables need to support
- // this method.
- logger.debug(
- "primary table ({}) threw exception when adding relationship",
- primaryTable);
- }
-
- // Ticket #144: Some tables have relations with them selves and then
- // the
- // relationship should only be added once.
- if (foreignTable != primaryTable
- && foreignTable instanceof MutableTable) {
- try {
- ((MutableTable) foreignTable).addRelationship(relation);
- } catch (UnsupportedOperationException e) {
- // this is an allowed behaviour - not all tables need to
- // support this method.
- logger.debug(
- "foreign table ({}) threw exception when adding relationship",
- foreignTable);
- }
- }
- }
- return relation;
- }
-
- public void remove() {
- Table primaryTable = getPrimaryTable();
- if (primaryTable instanceof MutableTable) {
- ((MutableTable) primaryTable).removeRelationship(this);
- }
- Table foreignTable = getForeignTable();
- if (foreignTable instanceof MutableTable) {
- ((MutableTable) foreignTable).removeRelationship(this);
- }
- }
-
- @Override
- protected void finalize() throws Throwable {
- super.finalize();
- remove();
- }
-
- public static Relationship createRelationship(Column primaryColumn,
- Column foreignColumn) {
- return createRelationship(new Column[] { primaryColumn },
- new Column[] { foreignColumn });
- }
-
- /**
- * Prevent external instantiation
- */
- private MutableRelationship(Column[] primaryColumns, Column[] foreignColumns) {
- _primaryColumns = primaryColumns;
- _foreignColumns = foreignColumns;
- }
-
- @Override
- public Column[] getPrimaryColumns() {
- return _primaryColumns;
- }
-
- @Override
- public Column[] getForeignColumns() {
- return _foreignColumns;
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-metamodel/blob/e2e2b37a/core/src/main/java/org/eobjects/metamodel/schema/MutableSchema.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/eobjects/metamodel/schema/MutableSchema.java b/core/src/main/java/org/eobjects/metamodel/schema/MutableSchema.java
deleted file mode 100644
index 71d05d2..0000000
--- a/core/src/main/java/org/eobjects/metamodel/schema/MutableSchema.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.eobjects.metamodel.schema;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-/**
- * Represents a schema and it's metadata. Schemas represent a collection of
- * tables.
- *
- * @see Table
- */
-public class MutableSchema extends AbstractSchema implements Serializable,
- Schema {
-
- private static final long serialVersionUID = 4465197783868238863L;
-
- private String _name;
- private final List<MutableTable> _tables;
-
- public MutableSchema() {
- super();
- _tables = new ArrayList<MutableTable>();
- }
-
- public MutableSchema(String name) {
- this();
- _name = name;
- }
-
- public MutableSchema(String name, MutableTable... tables) {
- this(name);
- setTables(tables);
- }
-
- @Override
- public String getName() {
- return _name;
- }
-
- public MutableSchema setName(String name) {
- _name = name;
- return this;
- }
-
- @Override
- public MutableTable[] getTables() {
- MutableTable[] array = new MutableTable[_tables.size()];
- return _tables.toArray(array);
- }
-
- public MutableSchema setTables(Collection<? extends MutableTable> tables) {
- clearTables();
- for (MutableTable table : tables) {
- _tables.add(table);
- }
- return this;
- }
-
- public MutableSchema setTables(MutableTable... tables) {
- clearTables();
- for (MutableTable table : tables) {
- _tables.add(table);
- }
- return this;
- }
-
- public MutableSchema clearTables() {
- _tables.clear();
- return this;
- }
-
- public MutableSchema addTable(MutableTable table) {
- _tables.add(table);
- return this;
- }
-
- public MutableSchema removeTable(Table table) {
- _tables.remove(table);
- return this;
- }
-
- @Override
- public String getQuote() {
- return null;
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-metamodel/blob/e2e2b37a/core/src/main/java/org/eobjects/metamodel/schema/MutableTable.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/eobjects/metamodel/schema/MutableTable.java b/core/src/main/java/org/eobjects/metamodel/schema/MutableTable.java
deleted file mode 100644
index fb54377..0000000
--- a/core/src/main/java/org/eobjects/metamodel/schema/MutableTable.java
+++ /dev/null
@@ -1,202 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.eobjects.metamodel.schema;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-/**
- * Represents the metadata about a table. Tables reside within a schema and
- * contains columns and relationships to other tables.
- *
- * @see Schema
- * @see Column
- * @see Relationship
- */
-public class MutableTable extends AbstractTable implements Serializable {
-
- private static final long serialVersionUID = -5094888465714027354L;
- protected String _name;
- protected TableType _type;
- protected String _remarks;
- protected Schema _schema;
- protected final List<Column> _columns;
- protected final List<Relationship> _relationships;
- protected String _quoteString = null;
-
- public MutableTable() {
- super();
- _columns = new ArrayList<Column>();
- _relationships = new ArrayList<Relationship>();
- }
-
- public MutableTable(String name) {
- this();
- setName(name);
- }
-
- public MutableTable(String name, TableType type) {
- this(name);
- _type = type;
- }
-
- public MutableTable(String name, TableType type, Schema schema) {
- this(name, type);
- _schema = schema;
- }
-
- public MutableTable(String name, TableType type, Schema schema, Column... columns) {
- this(name, type, schema);
- setColumns(columns);
- }
-
- @Override
- public String getName() {
- return _name;
- }
-
- public MutableTable setName(String name) {
- _name = name;
- return this;
- }
-
- /**
- * Internal getter for the columns of the table. Overwrite this method to
- * implement column lookup, column lazy-loading or similar.
- */
- protected List<Column> getColumnsInternal() {
- return _columns;
- }
-
- /**
- * Internal getter for the relationships of the table. Overwrite this method
- * to implement relationship lookup, relationship lazy-loading or similar.
- */
- protected List<Relationship> getRelationshipsInternal() {
- return _relationships;
- }
-
- @Override
- public Column[] getColumns() {
- List<Column> columns = getColumnsInternal();
- return columns.toArray(new Column[columns.size()]);
- }
-
- public MutableTable setColumns(Column... columns) {
- _columns.clear();
- for (Column column : columns) {
- _columns.add(column);
- }
- return this;
- }
-
- public MutableTable setColumns(Collection<Column> columns) {
- _columns.clear();
- for (Column column : columns) {
- _columns.add(column);
- }
- return this;
- }
-
- public MutableTable addColumn(Column column) {
- _columns.add(column);
- return this;
- }
-
- public MutableTable addColumn(int index, Column column) {
- _columns.add(index, column);
- return this;
- }
-
- public MutableTable removeColumn(Column column) {
- _columns.remove(column);
- return this;
- }
-
- @Override
- public Schema getSchema() {
- return _schema;
- }
-
- public MutableTable setSchema(Schema schema) {
- _schema = schema;
- return this;
- }
-
- @Override
- public TableType getType() {
- return _type;
- }
-
- public MutableTable setType(TableType type) {
- _type = type;
- return this;
- }
-
- @Override
- public Relationship[] getRelationships() {
- List<Relationship> relationships = getRelationshipsInternal();
- return relationships.toArray(new Relationship[relationships.size()]);
- }
-
- /**
- * Protected method for adding a relationship to this table. Should not be
- * used. Use Relationship.createRelationship(Column[], Column[]) instead.
- */
- protected void addRelationship(Relationship relation) {
- for (Relationship existingRelationship : _relationships) {
- if (existingRelationship.equals(relation)) {
- // avoid duplicate relationships
- return;
- }
- }
- _relationships.add(relation);
- }
-
- /**
- * Protected method for removing a relationship from this table. Should not
- * be used. Use Relationship.remove() instead.
- */
- protected MutableTable removeRelationship(Relationship relation) {
- _relationships.remove(relation);
- return this;
- }
-
- @Override
- public String getRemarks() {
- return _remarks;
- }
-
- public MutableTable setRemarks(String remarks) {
- _remarks = remarks;
- return this;
- }
-
- @Override
- public String getQuote() {
- return _quoteString;
- }
-
- public MutableTable setQuote(String quoteString) {
- _quoteString = quoteString;
- return this;
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-metamodel/blob/e2e2b37a/core/src/main/java/org/eobjects/metamodel/schema/NamedStructure.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/eobjects/metamodel/schema/NamedStructure.java b/core/src/main/java/org/eobjects/metamodel/schema/NamedStructure.java
deleted file mode 100644
index a5027d6..0000000
--- a/core/src/main/java/org/eobjects/metamodel/schema/NamedStructure.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.eobjects.metamodel.schema;
-
-import org.eobjects.metamodel.util.HasName;
-
-/**
- * Super-interface for named structural types in a DataContext.
- *
- * @author Kasper Sørensen
- */
-public interface NamedStructure extends HasName {
-
- /**
- * Gets the name of this structure.
- *
- * @return The name of the structure
- */
- public String getName();
-
- /**
- * Gets an optional quote string that is used to enclose the name of this
- * structure.
- *
- * @return A quote string used to enclose the name or null if none exists.
- */
- public String getQuote();
-
- /**
- * Gets the name, including optional quotes, of this structure.
- *
- * @return The name of the structure with added quote strings.
- */
- public String getQuotedName();
-
- /**
- * Gets a qualified label for later lookup. Typically this qualified label
- * is formatted with a simple dot separator. For example, for a column a
- * typical qualified label would be: "MY_SCHEMA.MY_TABLE.MY_COLUMN".
- *
- * The qualified label can be used as a unique identifier for the structure
- * but is not necessarily directly transferable to SQL syntax.
- *
- * @return a qualified label
- */
- public String getQualifiedLabel();
-}
http://git-wip-us.apache.org/repos/asf/incubator-metamodel/blob/e2e2b37a/core/src/main/java/org/eobjects/metamodel/schema/Relationship.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/eobjects/metamodel/schema/Relationship.java b/core/src/main/java/org/eobjects/metamodel/schema/Relationship.java
deleted file mode 100644
index 00a63d9..0000000
--- a/core/src/main/java/org/eobjects/metamodel/schema/Relationship.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.eobjects.metamodel.schema;
-
-import java.io.Serializable;
-
-/**
- * Represents a relationship between two tables where one set of columns is the
- * primary key, and another set is the foreign key.
- *
- * @see Table
- * @see Column
- *
- * @author Kasper Sørensen
- */
-public interface Relationship extends Serializable, Comparable<Relationship> {
-
- /**
- * Gets the table of the primary key column(s).
- *
- * @return the table of the primary key column(s).
- */
- public Table getPrimaryTable();
-
- /**
- * Gets the primary key columns of this relationship.
- *
- * @return an array of primary key columns.
- */
- public Column[] getPrimaryColumns();
-
- /**
- * Gets the table of the foreign key column(s).
- *
- * @return the table of the foreign key column(s).
- */
- public Table getForeignTable();
-
- /**
- * Gets the foreign key columns of this relationship.
- *
- * @return an array of foreign key columns.
- */
- public Column[] getForeignColumns();
-
- /**
- * Determines whether this relationship contains a specific pair of columns
- *
- * @param pkColumn
- * primary key column
- * @param fkColumn
- * foreign key column
- * @return true if this relation contains the specified primary and foreign
- * columns as a part of the relation
- */
- public boolean containsColumnPair(Column pkColumn, Column fkColumn);
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-metamodel/blob/e2e2b37a/core/src/main/java/org/eobjects/metamodel/schema/Schema.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/eobjects/metamodel/schema/Schema.java b/core/src/main/java/org/eobjects/metamodel/schema/Schema.java
deleted file mode 100644
index 6aa7183..0000000
--- a/core/src/main/java/org/eobjects/metamodel/schema/Schema.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.eobjects.metamodel.schema;
-
-import java.io.Serializable;
-
-import org.eobjects.metamodel.DataContext;
-
-/**
- * Represents a schema and it's metadata description. Schemas represent a
- * collection of tables.
- *
- * @see DataContext
- * @see Table
- *
- * @author Kasper Sørensen
- */
-public interface Schema extends Comparable<Schema>, Serializable, NamedStructure {
-
- /**
- * Gets the name of this Schema
- *
- * @return the name of this Schema
- */
- @Override
- public String getName();
-
- /**
- * Gets the number of tables that reside in this schema.
- *
- * @return the number of tables that reside in this schema.
- */
- public int getTableCount();
-
- /**
- * Gets the number of tables in this Schema that comply to a given
- * TableType.
- *
- * @param type
- * the TableType to use for searching and matching.
- * @return the count of tables that match the provided TableType.
- */
- public int getTableCount(TableType type);
-
- /**
- * Gets the names of the tables that reside in this Schema.
- *
- * @return an array of table names.
- */
- public String[] getTableNames();
-
- /**
- * Gets all tables in this Schema.
- *
- * @return the tables that reside in the schema
- */
- public Table[] getTables();
-
- /**
- * Gets all tables in this Schema of a particular type.
- *
- * @param type
- * the TableType to use for searching and matching.
- * @return an array of tables in this schema that matches the specified
- * type.
- */
- public Table[] getTables(TableType type);
-
- /**
- * Gets a table by index. Use {@link #getTableCount()} to get the (0-based)
- * index range
- *
- * @param index
- * the index of the table
- * @return the column with the specified index
- *
- * @throws IndexOutOfBoundsException
- * if the index is out of bounds (index >= table count)
- */
- public Table getTable(int index) throws IndexOutOfBoundsException;
-
- /**
- * Convenience method for retrieving a table by it's name.
- *
- * @param tableName
- * the name of the table to retrieve
- * @return the table with the given name. Returns null if no such table is
- * found.
- */
- public Table getTableByName(String tableName);
-
- /**
- * Gets all relationships to and from this Schema.
- *
- * @return an array of relationships.
- */
- public Relationship[] getRelationships();
-
- /**
- * Gets the number of relationships to and from this Schema.
- *
- * @return the number of relationships to and from this Schema
- */
- public int getRelationshipCount();
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-metamodel/blob/e2e2b37a/core/src/main/java/org/eobjects/metamodel/schema/SuperColumnType.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/eobjects/metamodel/schema/SuperColumnType.java b/core/src/main/java/org/eobjects/metamodel/schema/SuperColumnType.java
deleted file mode 100644
index d6545bc..0000000
--- a/core/src/main/java/org/eobjects/metamodel/schema/SuperColumnType.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.eobjects.metamodel.schema;
-
-import java.util.Date;
-
-/**
- * Represents an abstract, generalized type of column
- */
-public enum SuperColumnType {
-
- BOOLEAN_TYPE(Boolean.class),
-
- LITERAL_TYPE(String.class),
-
- NUMBER_TYPE(Number.class),
-
- TIME_TYPE(Date.class),
-
- BINARY_TYPE(byte[].class),
-
- OTHER_TYPE(Object.class);
-
- private Class<?> _javaEquivalentClass;
-
- private SuperColumnType(Class<?> javaEquivalentClass) {
- _javaEquivalentClass = javaEquivalentClass;
- }
-
- /**
- * @return a java class that is appropriate for handling column values of
- * this column super type
- */
- public Class<?> getJavaEquivalentClass() {
- return _javaEquivalentClass;
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-metamodel/blob/e2e2b37a/core/src/main/java/org/eobjects/metamodel/schema/Table.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/eobjects/metamodel/schema/Table.java b/core/src/main/java/org/eobjects/metamodel/schema/Table.java
deleted file mode 100644
index bc9043c..0000000
--- a/core/src/main/java/org/eobjects/metamodel/schema/Table.java
+++ /dev/null
@@ -1,215 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.eobjects.metamodel.schema;
-
-import java.io.Serializable;
-
-/**
- * Represents a table and it's metadata description. Tables reside within a
- * schema and contains columns and relationships to other tables.
- *
- * @see Schema
- * @see Column
- *
- * @author Kasper Sørensen
- */
-public interface Table extends Comparable<Table>, Serializable, NamedStructure {
-
- /**
- * Gets the name of this Table
- *
- * @return the name of this Table
- */
- @Override
- public String getName();
-
- /**
- * Gets the number of columns in this table.
- *
- * @return the number of columns in this table.
- */
- public int getColumnCount();
-
- /**
- * Gets the columns of this table.
- *
- * @return the columns of this table.
- */
- public Column[] getColumns();
-
- /**
- * Convenience method for retrieving a column by it's name.
- *
- * @param columnName
- * the name of the column to retrieve
- * @return the column with the given name. Returns null if no such column is
- * found.
- */
- public Column getColumnByName(String columnName);
-
- /**
- * Gets a column by index. Use {@link #getColumnCount()} to get the
- * (0-based) index range.
- *
- * @param index
- * the index of the column
- * @return the column with the specified index
- * @throws IndexOutOfBoundsException
- * if the index is out of bounds (index >= column count)
- */
- public Column getColumn(int index) throws IndexOutOfBoundsException;
-
- /**
- * Gets the schema that this table resides in.
- *
- * @return the schema that the table resides in.
- */
- public Schema getSchema();
-
- /**
- * Gets the table type of this table.
- *
- * @return the type of table
- */
- public TableType getType();
-
- /**
- * Gets all relationships for this table.
- *
- * @return all relationsips for this table. To add relations use
- * TableRelation.createRelation();
- */
- public Relationship[] getRelationships();
-
- /**
- * Gets relationships between this table and another table.
- *
- * @param otherTable
- * another table for which to find relationships to and from.
- * @return an array of relationsips between this and the other table.
- */
- public Relationship[] getRelationships(Table otherTable);
-
- /**
- * Gets a count of relationships to and from this table.
- *
- * @return a count of relationships to and from this table.
- */
- public int getRelationshipCount();
-
- /**
- * Gets remarks/comments to this table.
- *
- * @return remarks/comments to this table or null if none exist.
- */
- public String getRemarks();
-
- /**
- * Gets all of this table's columns that are of number type.
- *
- * @return an array of columns.
- * @see ColumnType
- */
- public Column[] getNumberColumns();
-
- /**
- * Gets all of this table's columns that are of literal (String/text) type.
- *
- * @return an array of columns.
- * @see ColumnType
- */
- public Column[] getLiteralColumns();
-
- /**
- * Gets all of this table's columns that are time and/or date based.
- *
- * @return an array of columns.
- * @see ColumnType
- */
- public Column[] getTimeBasedColumns();
-
- /**
- * Gets all of this table's columns that are of boolean type.
- *
- * @return an array of columns.
- * @see ColumnType
- */
- public Column[] getBooleanColumns();
-
- /**
- * Gets all of this table's columns that are indexed.
- *
- * @return an array of columns.
- */
- public Column[] getIndexedColumns();
-
- /**
- * @return the relationships where this table is the foreign table
- */
- public Relationship[] getForeignKeyRelationships();
-
- /**
- * @return the relationships where this table is the primary table
- */
- public Relationship[] getPrimaryKeyRelationships();
-
- /**
- * Gets the columns of this table that are known to be foreign keys (ie.
- * references primary keys in other tables).
- *
- * @return an array of columns that are known to be foreign keys.
- */
- public Column[] getForeignKeys();
-
- /**
- * Gets the columns of this table that are known to be primary keys. See
- * {@link Column#isPrimaryKey()}.
- *
- * @return an array of columns that are known to be primary keys.
- */
- public Column[] getPrimaryKeys();
-
- /**
- * Gets the names of this table's columns.
- *
- * @return an array of column names.
- */
- public String[] getColumnNames();
-
- /**
- * Gets the columns of this table that conforms to a specified
- * {@link ColumnType}.
- *
- * @param columnType
- * the column type to search for.
- * @return an array of columns that match the specified ColumnType.
- */
- public Column[] getColumnsOfType(ColumnType columnType);
-
- /**
- * Gets the columns of this table that conforms to a specified
- * {@link SuperColumnType}.
- *
- * @param superColumnType
- * the super type of the column
- * @return an array of columns that match the specified SuperColumnType.
- */
- public Column[] getColumnsOfSuperType(SuperColumnType superColumnType);
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-metamodel/blob/e2e2b37a/core/src/main/java/org/eobjects/metamodel/schema/TableType.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/eobjects/metamodel/schema/TableType.java b/core/src/main/java/org/eobjects/metamodel/schema/TableType.java
deleted file mode 100644
index 51b7361..0000000
--- a/core/src/main/java/org/eobjects/metamodel/schema/TableType.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.eobjects.metamodel.schema;
-
-/**
- * Represents the various types of tables
- */
-public enum TableType {
-
- TABLE, VIEW, SYSTEM_TABLE, GLOBAL_TEMPORARY, LOCAL_TEMPORARY, ALIAS, SYNONYM, OTHER;
-
- public static final TableType[] DEFAULT_TABLE_TYPES = new TableType[] {
- TableType.TABLE, TableType.VIEW };
-
- public boolean isMaterialized() {
- switch (this) {
- case TABLE:
- case SYSTEM_TABLE:
- return true;
- default:
- return false;
- }
- }
-
- /**
- * Tries to resolve a TableType based on an incoming string/literal. If no
- * fitting TableType is found, OTHER will be returned.
- */
- public static TableType getTableType(String literalType) {
- literalType = literalType.toUpperCase();
- if ("TABLE".equals(literalType)) {
- return TABLE;
- }
- if ("VIEW".equals(literalType)) {
- return VIEW;
- }
- if ("SYSTEM_TABLE".equals(literalType)) {
- return SYSTEM_TABLE;
- }
- if ("GLOBAL_TEMPORARY".equals(literalType)) {
- return GLOBAL_TEMPORARY;
- }
- if ("LOCAL_TEMPORARY".equals(literalType)) {
- return LOCAL_TEMPORARY;
- }
- if ("ALIAS".equals(literalType)) {
- return ALIAS;
- }
- if ("SYNONYM".equals(literalType)) {
- return SYNONYM;
- }
- return OTHER;
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-metamodel/blob/e2e2b37a/core/src/main/java/org/eobjects/metamodel/schema/package-info.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/eobjects/metamodel/schema/package-info.java b/core/src/main/java/org/eobjects/metamodel/schema/package-info.java
deleted file mode 100644
index 05a5e88..0000000
--- a/core/src/main/java/org/eobjects/metamodel/schema/package-info.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-/**
- * API for schema structure
- */
-package org.eobjects.metamodel.schema;
-
http://git-wip-us.apache.org/repos/asf/incubator-metamodel/blob/e2e2b37a/core/src/main/java/org/eobjects/metamodel/update/AbstractRowUpdationBuilder.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/eobjects/metamodel/update/AbstractRowUpdationBuilder.java b/core/src/main/java/org/eobjects/metamodel/update/AbstractRowUpdationBuilder.java
deleted file mode 100644
index 59fdd10..0000000
--- a/core/src/main/java/org/eobjects/metamodel/update/AbstractRowUpdationBuilder.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.eobjects.metamodel.update;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eobjects.metamodel.data.AbstractRowBuilder;
-import org.eobjects.metamodel.query.FilterClause;
-import org.eobjects.metamodel.query.FilterItem;
-import org.eobjects.metamodel.query.SelectItem;
-import org.eobjects.metamodel.query.builder.AbstractFilterBuilder;
-import org.eobjects.metamodel.query.builder.FilterBuilder;
-import org.eobjects.metamodel.schema.Column;
-import org.eobjects.metamodel.schema.Table;
-
-/**
- * Abstract {@link RowUpdationBuilder} implementation.
- */
-public abstract class AbstractRowUpdationBuilder extends AbstractRowBuilder<RowUpdationBuilder> implements
- RowUpdationBuilder {
-
- private final Table _table;
- private final List<FilterItem> _whereItems;
-
- public AbstractRowUpdationBuilder(Table table) {
- super(table);
- _table = table;
- _whereItems = new ArrayList<FilterItem>();
- }
-
- protected List<FilterItem> getWhereItems() {
- return _whereItems;
- }
-
- @Override
- public FilterBuilder<RowUpdationBuilder> where(Column column) {
- SelectItem selectItem = new SelectItem(column);
- return new AbstractFilterBuilder<RowUpdationBuilder>(selectItem) {
- @Override
- protected RowUpdationBuilder applyFilter(FilterItem filter) {
- return where(filter);
- }
- };
- }
-
- @Override
- public FilterBuilder<RowUpdationBuilder> where(String columnName) {
- Column column = _table.getColumnByName(columnName);
- if (column == null) {
- throw new IllegalArgumentException("No such column: " + columnName);
- }
- return where(column);
- }
-
- @Override
- public RowUpdationBuilder where(FilterItem... filterItems) {
- for (FilterItem filterItem : filterItems) {
- _whereItems.add(filterItem);
- }
- return this;
- }
-
- @Override
- public RowUpdationBuilder where(Iterable<FilterItem> filterItems) {
- for (FilterItem filterItem : filterItems) {
- _whereItems.add(filterItem);
- }
- return this;
- }
-
- @Override
- public Table getTable() {
- return _table;
- }
-
- @Override
- public String toSql() {
- StringBuilder sb = new StringBuilder();
- sb.append("UPDATE ");
- sb.append(_table.getQualifiedLabel());
- sb.append(" SET ");
- Column[] columns = getColumns();
- Object[] values = getValues();
-
- for (int i = 0; i < columns.length; i++) {
- if (i != 0) {
- sb.append(',');
- }
- sb.append(columns[i].getName());
- sb.append('=');
- sb.append(values[i] == null ? "NULL" : values[i].toString());
- }
-
- List<FilterItem> whereItems = getWhereItems();
- String whereClause = new FilterClause(null, " WHERE ").addItems(whereItems).toSql();
- sb.append(whereClause);
- return sb.toString();
- }
-
- @Override
- public String toString() {
- return toSql();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-metamodel/blob/e2e2b37a/core/src/main/java/org/eobjects/metamodel/update/RowUpdateable.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/eobjects/metamodel/update/RowUpdateable.java b/core/src/main/java/org/eobjects/metamodel/update/RowUpdateable.java
deleted file mode 100644
index 3afa7e2..0000000
--- a/core/src/main/java/org/eobjects/metamodel/update/RowUpdateable.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.eobjects.metamodel.update;
-
-import org.eobjects.metamodel.schema.Table;
-
-public interface RowUpdateable {
-
- /**
- * Determines whether row update is supported
- *
- * @return true if row update is supported
- */
- public boolean isUpdateSupported();
-
- /**
- * Initiates a row updation builder.
- *
- * @param table
- * @return
- * @throws IllegalArgumentException
- * @throws IllegalStateException
- * @throws UnsupportedOperationException
- */
- public RowUpdationBuilder update(Table table) throws IllegalArgumentException, IllegalStateException,
- UnsupportedOperationException;
-
- /**
- * Initiates a row updation builder.
- *
- * @param tableName
- * @return
- * @throws IllegalArgumentException
- * @throws IllegalStateException
- * @throws UnsupportedOperationException
- */
- public RowUpdationBuilder update(String tableName) throws IllegalArgumentException, IllegalStateException,
- UnsupportedOperationException;
-
- /**
- * Initiates a row updation builder.
- *
- * @param schemaName
- * @param tableName
- * @return
- * @throws IllegalArgumentException
- * @throws IllegalStateException
- * @throws UnsupportedOperationException
- */
- public RowUpdationBuilder update(String schemaName, String tableName) throws IllegalArgumentException,
- IllegalStateException, UnsupportedOperationException;
-}
http://git-wip-us.apache.org/repos/asf/incubator-metamodel/blob/e2e2b37a/core/src/main/java/org/eobjects/metamodel/update/RowUpdationBuilder.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/eobjects/metamodel/update/RowUpdationBuilder.java b/core/src/main/java/org/eobjects/metamodel/update/RowUpdationBuilder.java
deleted file mode 100644
index 71df267..0000000
--- a/core/src/main/java/org/eobjects/metamodel/update/RowUpdationBuilder.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.eobjects.metamodel.update;
-
-import org.eobjects.metamodel.DataContext;
-import org.eobjects.metamodel.MetaModelException;
-import org.eobjects.metamodel.data.RowBuilder;
-import org.eobjects.metamodel.data.WhereClauseBuilder;
-import org.eobjects.metamodel.schema.Table;
-
-/**
- * Builder object for row update on a {@link Table}.
- *
- * @author Kasper Sørensen
- */
-public interface RowUpdationBuilder extends RowBuilder<RowUpdationBuilder>, WhereClauseBuilder<RowUpdationBuilder> {
-
- /**
- * Gets the table that this update pertains to.
- *
- * @return the table that this update pertains to.
- */
- @Override
- public Table getTable();
-
- /**
- * Gets a SQL representation of this update operation. Note that the
- * generated SQL is dialect agnostic, so it is not accurately the same as
- * what will be passed to a potential backing database.
- *
- * @return a SQL representation of this update operation.
- */
- public String toSql();
-
- /**
- * Commits the row updation operation. This operation will overwrite rows in
- * the {@link DataContext}.
- *
- * @throws MetaModelException
- * if the operation was rejected
- */
- public void execute() throws MetaModelException;
-}