/*
 *
 *  Copyright 2018 FJN Corp.
 *
 *  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.
 *
 *  Author                        Date                       Issue
 *  fs1194361820@163.com          2015-01-01                 Initial Version
 *
 */

/*
 * Hibernate, Relational Persistence for Idiomatic Java
 *
 * License: GNU Lesser General Public License (LGPL), version 2.1 or later.
 * See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
 */
package com.fjn.helper.common.sql.dialect.dialect;


/**
 * SQL Dialect for Sybase Anywhere
 * extending Sybase (Enterprise) Dialect
 * (Tested on ASA 8.x)
 */
public class SybaseAnywhereDialect extends SybaseDialect {
    /**
     * Sybase Anywhere syntax would require a "DEFAULT" for each column specified,
     * but I suppose Hibernate use this syntax only with tables with just 1 column
     * <p/>
     * {@inheritDoc}
     */
    @Override
    public String getNoColumnsInsertString() {
        return "values (default)";
    }

    /**
     * ASA does not require to drop constraint beforeQuery dropping tables, so disable it.
     * <p/>
     * NOTE : Also, the DROP statement syntax used by Hibernate to drop constraints is
     * not compatible with ASA.
     * <p/>
     * {@inheritDoc}
     */
    @Override
    public boolean dropConstraints() {
        return false;
    }

}
