All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.eclipse.persistence.jpa.jpql.EclipseLinkSemanticValidatorExtension Maven / Gradle / Ivy

There is a newer version: 5.0.0-B03
Show newest version
/*
 * Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
 *
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License v. 2.0 which is available at
 * http://www.eclipse.org/legal/epl-2.0,
 * or the Eclipse Distribution License v. 1.0 which is available at
 * http://www.eclipse.org/org/documents/edl-v10.php.
 *
 * SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
 */

// Contributors:
//     Oracle - initial API and implementation
//
package org.eclipse.persistence.jpa.jpql;

/**
 * This extension provides additional support to semantic validation by adding support for non-JPA
 * specific artifacts, such as database objects.
 *
 * @version 2.5
 * @since 2.5
 * @author Pascal Filion
 */
public interface EclipseLinkSemanticValidatorExtension {

    /**
     * A null-instance of this extension.
     */
    EclipseLinkSemanticValidatorExtension NULL_EXTENSION = new EclipseLinkSemanticValidatorExtension() {
        public boolean columnExists(String tableName, String columnName) {
            return false;
        }
        public String getEntityTable(String entityName) {
            return null;
        }
        public boolean tableExists(String tableName) {
            return false;
        }
    };

    /**
     * Determines whether the column with the given name exists or not in the table with the given name.
     *
     * @param tableName The name of the table to look for the column
     * @param columnName The name of the column to determine its existence
     * @return true if the column exists; false otherwise
     */
    boolean columnExists(String tableName, String columnName);

    /**
     * Returns the name of the primary table defined for the entity with the given name.
     *
     * @param entityName The name of the entity
     * @return The name of the entity's primary table
     */
    String getEntityTable(String entityName);

    /**
     * Determines whether the table with the given exists or not.
     *
     * @param tableName The name of the table to determine its existence
     * @return true if the table exists; false otherwise
     */
    boolean tableExists(String tableName);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy