/**
 *
 * Copyright (c) 2006-2017, Speedment, Inc. All Rights Reserved.
 *
 * Licensed 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 com.speedment.runtime.config.identifier;

import com.speedment.runtime.config.identifier.trait.HasDbmsName;
import com.speedment.runtime.config.identifier.trait.HasSchemaName;
import com.speedment.runtime.config.identifier.trait.HasTableName;
import com.speedment.runtime.config.internal.identifier.TableIdentifierImpl;
import com.speedment.runtime.config.util.DocumentDbUtil;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * Identifies a particular Table. The identifier is an immutable non-complex
 * object that only contains the names of the nodes required to uniquely
 * identify it in the database.
 * <p>
 * To find the actual documents referred to by the identifier, the following
 * utility methods can be used:
 * <ul>
 *
 * <li>DocumentDbUtil#referencedTable(Project, Project, TableIdentifier)
 * <li>DocumentDbUtil#referencedSchema(Project, Project, TableIdentifier)
 * <li>DocumentDbUtil#referencedDbms(Project, TableIdentifier)
 * </ul>
 *
 * @param <ENTITY> the entity type
 *
 * @author Per Minborg
 * @since 3.0.1
 * @see DocumentDbUtil
 */
public interface TableIdentifier<ENTITY> extends
    HasDbmsName,
    HasSchemaName,
    HasTableName {

    default SchemaIdentifier<ENTITY> asSchemaIdentifier() {
        return SchemaIdentifier.of(getDbmsName(), getSchemaName());
    }

    class Hidden {

        private static final Map<TableIdentifier<?>, TableIdentifier<?>> INTERNED = new ConcurrentHashMap<>();

    }

    static <ENTITY> TableIdentifier<ENTITY> of(String dbmsName, String schemaName, String tableName) {
        final TableIdentifier<ENTITY> newId = new TableIdentifierImpl<>(dbmsName, schemaName, tableName);
        Hidden.INTERNED.putIfAbsent(newId, newId);

        @SuppressWarnings("unchecked")
        final TableIdentifier<ENTITY> result = (TableIdentifier<ENTITY>) Hidden.INTERNED.get(newId);
        return result;
    }
}

@@ -1685,16 +1685,17 @@
  @since 
+ 
 3.0.1%0A *
@@ -1768,16 +1768,20 @@
 extends%0A
+    
     HasD
@@ -1793,16 +1793,20 @@
 me,%0A    
+  
+  
 HasSchem
@@ -1816,16 +1816,20 @@
 me,%0A    
+   
+ 
 HasTable
@@ -1844,158 +1844,789 @@
     
-default SchemaIdentifier%3CENTITY%3E asSchemaIdentifier() %7B%0A        return SchemaIdentifier.of(getDbmsName(), getSchemaName());%0A    %7D%0A%0A    class Hidden %7B%0A
+/**%0A     * Returns a %7B@link SchemaIdentifier%7D that represents the schema that this%0A     * table resides in.%0A     *%0A     * @return  the schema identifier%0A     */%0A    default SchemaIdentifier%3CENTITY%3E asSchemaIdentifier() %7B%0A        return SchemaIdentifier.of(getDbmsName(), getSchemaName());%0A    %7D%0A%0A    /**%0A     * Returns a %7B@link ColumnIdentifier%7D that represents a particular column in%0A     * this table.%0A     *%0A     * @param columnName  the database name of the column%0A     * @return            the column identifier%0A     */%0A    default ColumnIdentifier%3CENTITY%3E asColumnIdentifier(String columnName) %7B%0A        return ColumnIdentifier.of(%0A            getDbmsName(),%0A            getSchemaName(),%0A            getTableName(),%0A            columnName%0A        );%0A    %7D%0A%0A    class Hidden %7B
 %0A   
@@ -2733,17 +2733,16 @@
 ap%3C%3E();%0A
-%0A
     %7D%0A%0A 

Add asColumnIdentifier method in TableIdentifier