001/**
002 * Copyright (C) 2006-2024 Talend Inc. - www.talend.com
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016package org.talend.sdk.component.api.record;
017
018public interface SchemaProperty {
019
020    String ORIGIN_TYPE = "field.origin.type";
021
022    String LOGICAL_TYPE = "field.logical.type";
023
024    String SIZE = "field.size";
025
026    String SCALE = "field.scale";
027
028    String PATTERN = "field.pattern";
029
030    String STUDIO_TYPE = "talend.studio.type";
031
032    String IS_KEY = "field.key";
033
034    String IS_FOREIGN_KEY = "field.foreign.key";
035
036    String IS_UNIQUE = "field.unique";
037
038    String ALLOW_SPECIAL_NAME = "field.special.name";
039
040    enum LogicalType {
041
042        DATE("date"),
043        TIME("time"),
044        TIMESTAMP("timestamp"),
045        UUID("uuid") {
046
047            @Override
048            public Schema.Type storageType() {
049                return Schema.Type.STRING;
050            }
051        };
052
053        private String logicalType;
054
055        LogicalType(final String logicalType) {
056            this.logicalType = logicalType;
057        }
058
059        public String key() {
060            return this.logicalType;
061        }
062
063        public Schema.Type storageType() {
064            return Schema.Type.DATETIME;
065        }
066    }
067
068}