/*
 * DBeaver - Universal Database Manager
 * Copyright (C) 2010-2023 DBeaver Corp and others
 *
 * 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 org.jkiss.dbeaver.ext.sqlite.model;

import org.jkiss.dbeaver.ext.generic.model.GenericTableBase;
import org.jkiss.dbeaver.ext.generic.model.GenericTableColumn;
import org.jkiss.dbeaver.model.DBPNamedObject2;
import org.jkiss.dbeaver.model.impl.DBDummyNumberTransformer;
import org.jkiss.dbeaver.model.meta.Property;

public class SQLiteTableColumn extends GenericTableColumn implements DBPNamedObject2 {
    public SQLiteTableColumn(GenericTableBase table, String columnName, String typeName, int valueType, int sourceType, int ordinalPosition, long columnSize, long charLength, Integer scale, Integer precision, int radix, boolean notNull, String remarks, String defaultValue, boolean autoIncrement, boolean autoGenerated) {
        super(table, columnName, typeName, valueType, sourceType, ordinalPosition, columnSize, charLength, scale, precision, radix, notNull, remarks, defaultValue, autoIncrement, autoGenerated);
    }

    // Not a property
    @Override
    public boolean isAutoGenerated() {
        return super.isAutoGenerated();
    }

    @Property(viewable = true, editable = true, order = 52, editableExpr = "!object.table.persisted")
    @Override
    public boolean isAutoIncrement() {
        return super.isAutoIncrement();
    }

    @Property(viewable = true, editable = true, order = 40, valueRenderer = DBDummyNumberTransformer.class)
    @Override
    public long getMaxLength() {
        return super.getMaxLength();
    }

    // Not a property
    @Override
    public Integer getScale() {
        return super.getScale();
    }

    // Not a property
    @Override
    public Integer getPrecision() {
        return super.getPrecision();
    }
}
