This project has retired. For details please refer to its
Attic page.
ColumnReference xref
1/*2 * Licensed to the Apache Software Foundation (ASF) under one3 * or more contributor license agreements. See the NOTICE file4 * distributed with this work for additional information5 * regarding copyright ownership. The ASF licenses this file6 * to you under the Apache License, Version 2.0 (the7 * "License"); you may not use this file except in compliance8 * with the License. You may obtain a copy of the License at9 *10 * http://www.apache.org/licenses/LICENSE-2.011 *12 * Unless required by applicable law or agreed to in writing,13 * software distributed under the License is distributed on an14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY15 * KIND, either express or implied. See the License for the16 * specific language governing permissions and limitations17 * under the License.18 */19package org.apache.chemistry.opencmis.server.support.query;
2021import org.apache.chemistry.opencmis.commons.definitions.PropertyDefinition;
22import org.apache.chemistry.opencmis.commons.definitions.TypeDefinition;
2324publicclassColumnReferenceextendsCmisSelector {
2526privatefinal String qualifier; // type qualifier coming from query statement27privatefinal String propQueryName; // property query name coming from query statement2829// The following fields are set when the types are resolved:30private String propertyId;
31private TypeDefinition typeDef;
3233publicColumnReference(String qualifier, String propQueryName) {
34this.qualifier = qualifier;
35this.propQueryName = propQueryName;
36 }
3738publicColumnReference(String propQueryName) {
39this.qualifier = null;
40this.propQueryName = propQueryName;
41 }
4243public String getQualifier() {
44return qualifier;
45 }
4647/** @deprecated use {@link #getQualifier} instead. */48 @Deprecated
49public String getTypeQueryName() {
50return getQualifier();
51 }
5253public String getPropertyQueryName() {
54return propQueryName;
55 }
5657 @Override
58public String getName() {
59return propQueryName;
60 }
6162publicvoid setTypeDefinition(String propertyId, TypeDefinition typeDef) {
63this.typeDef = typeDef;
64this.propertyId = propertyId;
65 }
6667public TypeDefinition getTypeDefinition() {
68return typeDef;
69 }
7071public PropertyDefinition<?> getPropertyDefinition() {
72return typeDef.getPropertyDefinitions().get(getPropertyId());
73 }
7475public String getPropertyId() {
76return propertyId;
77 }
7879 @Override
80public String toString() {
81return"ColumnReference("82 + (qualifier == null ? "" : qualifier + ".")
83 + propQueryName + (aliasName == null ? "" : " AS " + aliasName)
84 + ")";
85 }
86 }