org.apache.calcite.model.JsonSchema Maven / Gradle / Ivy
Show all versions of calcite-core Show documentation
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to you 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.apache.calcite.model;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import java.util.ArrayList;
import java.util.List;
/**
* Schema schema element.
*
* Occurs within {@link JsonRoot#schemas}.
*
* @see JsonRoot Description of schema elements
*/
@JsonTypeInfo(
use = JsonTypeInfo.Id.NAME,
property = "type",
defaultImpl = JsonMapSchema.class)
@JsonSubTypes({
@JsonSubTypes.Type(value = JsonMapSchema.class, name = "map"),
@JsonSubTypes.Type(value = JsonJdbcSchema.class, name = "jdbc"),
@JsonSubTypes.Type(value = JsonCustomSchema.class, name = "custom") })
public abstract class JsonSchema {
/** Name of the schema.
*
*
Required.
*
* @see JsonRoot#defaultSchema
*/
public String name;
/** SQL path that is used to resolve functions used in this schema.
*
*
May be null, or a list, each element of which is a string or a
* string-list.
*
*
For example,
*
*
path: [ ['usr', 'lib'], 'lib' ]
*
* declares a path with two elements: the schema '/usr/lib' and the schema
* '/lib'. Most schemas are at the top level, and for these you can use a
* string.
*/
public List