Home » Hibernate-3.3.2.GA » org.hibernate » engine » query » [javadoc | source]

    1   /*
    2    * Hibernate, Relational Persistence for Idiomatic Java
    3    *
    4    * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
    5    * indicated by the @author tags or express copyright attribution
    6    * statements applied by the authors.  All third-party contributions are
    7    * distributed under license by Red Hat Middleware LLC.
    8    *
    9    * This copyrighted material is made available to anyone wishing to use, modify,
   10    * copy, or redistribute it subject to the terms and conditions of the GNU
   11    * Lesser General Public License, as published by the Free Software Foundation.
   12    *
   13    * This program is distributed in the hope that it will be useful,
   14    * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   15    * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
   16    * for more details.
   17    *
   18    * You should have received a copy of the GNU Lesser General Public License
   19    * along with this distribution; if not, write to:
   20    * Free Software Foundation, Inc.
   21    * 51 Franklin Street, Fifth Floor
   22    * Boston, MA  02110-1301  USA
   23    *
   24    */
   25   package org.hibernate.engine.query;
   26   
   27   import org.hibernate.type.Type;
   28   
   29   import java.io.Serializable;
   30   import java.util.Set;
   31   
   32   /**
   33    * Defines metadata regarding a translated HQL or native-SQL query.
   34    *
   35    * @author Steve Ebersole
   36    */
   37   public class QueryMetadata implements Serializable {
   38   	private final String sourceQuery;
   39   	private final ParameterMetadata parameterMetadata;
   40   	private final String[] returnAliases;
   41   	private final Type[] returnTypes;
   42   	private final Set querySpaces;
   43   
   44   	public QueryMetadata(
   45   			String sourceQuery,
   46   	        ParameterMetadata parameterMetadata,
   47   	        String[] returnAliases,
   48   	        Type[] returnTypes,
   49   	        Set querySpaces) {
   50   		this.sourceQuery = sourceQuery;
   51   		this.parameterMetadata = parameterMetadata;
   52   		this.returnAliases = returnAliases;
   53   		this.returnTypes = returnTypes;
   54   		this.querySpaces = querySpaces;
   55   	}
   56   
   57   	/**
   58   	 * Get the source HQL or native-SQL query.
   59   	 *
   60   	 * @return The source query.
   61   	 */
   62   	public String getSourceQuery() {
   63   		return sourceQuery;
   64   	}
   65   
   66   	public ParameterMetadata getParameterMetadata() {
   67   		return parameterMetadata;
   68   	}
   69   
   70   	/**
   71   	 * Return source query select clause aliases (if any)
   72   	 *
   73   	 * @return an array of aliases as strings.
   74   	 */
   75   	public String[] getReturnAliases() {
   76   		return returnAliases;
   77   	}
   78   
   79   	/**
   80   	 * An array of types describing the returns of the source query.
   81   	 *
   82   	 * @return The return type array.
   83   	 */
   84   	public Type[] getReturnTypes() {
   85   		return returnTypes;
   86   	}
   87   
   88   	/**
   89   	 * The set of query spaces affected by this source query.
   90   	 *
   91   	 * @return The set of query spaces.
   92   	 */
   93   	public Set getQuerySpaces() {
   94   		return querySpaces;
   95   	}
   96   }

Home » Hibernate-3.3.2.GA » org.hibernate » engine » query » [javadoc | source]