001/**
002 * Copyright (C) 2006-2026 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    String ENTRY_IS_ON_ERROR = "record.value.on.error";
041
042    String ENTRY_ERROR_MESSAGE = "record.value.on.error.message";
043
044    String ENTRY_ERROR_FALLBACK_VALUE = "record.value.on.error.fallback_value";
045
046    enum LogicalType {
047
048        DATE("date"),
049        TIME("time"),
050        TIMESTAMP("timestamp"),
051        UUID("uuid") {
052
053            @Override
054            public Schema.Type storageType() {
055                return Schema.Type.STRING;
056            }
057        };
058
059        private String logicalType;
060
061        LogicalType(final String logicalType) {
062            this.logicalType = logicalType;
063        }
064
065        public String key() {
066            return this.logicalType;
067        }
068
069        public Schema.Type storageType() {
070            return Schema.Type.DATETIME;
071        }
072    }
073
074}