001/* 002 * Copyright (c) 2008, 2009, 2011 Oracle, Inc. All rights reserved. 003 * 004 * This program and the accompanying materials are made available under the 005 * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 006 * which accompanies this distribution. The Eclipse Public License is available 007 * at http://www.eclipse.org/legal/epl-v10.html and the Eclipse Distribution License 008 * is available at http://www.eclipse.org/org/documents/edl-v10.php. 009 */ 010package javax.persistence; 011 012/** 013 * The <code>TupleElement</code> interface defines an element that is returned in 014 * a query result tuple. 015 * 016 * @param <X> the type of the element 017 * @see Tuple 018 * @since Java Persistence 2.0 019 */ 020public interface TupleElement<X> { 021 /** 022 * Return the Java type of the tuple element. 023 * 024 * @return the Java type of the tuple element 025 */ 026 Class<? extends X> getJavaType(); 027 028 /** 029 * Return the alias assigned to the tuple element or null, 030 * if no alias has been assigned. 031 * 032 * @return alias 033 */ 034 String getAlias(); 035}