org.apache.openjpa.meta.QueryMetaData Maven / Gradle / Ivy
/*
* 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.openjpa.meta;
import java.io.File;
import java.io.Serializable;
import java.util.LinkedList;
import java.util.List;
import org.apache.commons.lang.StringUtils;
import org.apache.openjpa.kernel.Query;
import org.apache.openjpa.kernel.QueryLanguages;
import org.apache.openjpa.kernel.jpql.JPQLParser;
import org.apache.openjpa.lib.meta.SourceTracker;
import org.apache.openjpa.lib.util.OrderedMap;
import org.apache.openjpa.lib.xml.Commentable;
/**
* Holds metadata about named queries.
* Information stored in this instance gets transfered to
* new {@link Query} instances.
*
* @author Steve Kim
*/
public class QueryMetaData
implements MetaDataModes, SourceTracker, Commentable, Serializable {
private static final String[] EMPTY_KEYS = new String[0];
private static final Object[] EMPTY_VALS = new Object[0];
private final String _name;
private Boolean _readOnly;
private File _file;
private Object _scope;
private int _srcType;
private int _mode = MODE_QUERY;
private String _language;
private Class _class;
private Class _candidate;
private Class _res;
private String _query;
private String[] _comments;
private List _hintKeys;
private List _hintVals;
private String _resultSetMappingName;
private int _lineNum;
private int _colNum;
private String _srcName;
private boolean _convertPositionalParametersToNamed;
private OrderedMap