Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright (c) 2008, 2009 Sun Microsystems. All rights reserved.
   *
   * This program and the accompanying materials are made available under the
   * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
   * which accompanies this distribution.
   * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
   * and the Eclipse Distribution License is available at
   * http://www.eclipse.org/org/documents/edl-v10.php.
  *
  * Contributors:
  *     Linda DeMichiel - Java Persistence 2.0 - Version 2.0 (October 1, 2009)
  *     Specification available from http://jcp.org/en/jsr/detail?id=317
  */
 
 // $Id: ManagedType.java 20957 2011-06-13 09:58:51Z stliu $
 
 package javax.persistence.metamodel;
 
 import java.util.Set;

Instances of the type ManagedType represent entity, mapped superclass, and embeddable types.

Parameters:
<X> The represented type.
Since:
Java Persistence 2.0
 
 public interface ManagedType<X> extends Type<X> {
Return the attributes of the managed type.

Returns:
attributes of the managed type
 
 	Set<Attribute<? super X, ?>> getAttributes();

Return the attributes declared by the managed type. Returns empty set if the managed type has no declared attributes.

Returns:
declared attributes of the managed type
 
Return the single-valued attribute of the managed type that corresponds to the specified name and Java type.

Parameters:
name the name of the represented attribute
type the type of the represented attribute
Returns:
single-valued attribute with given name and type
Throws:
java.lang.IllegalArgumentException if attribute of the given name and type is not present in the managed type
 
 	<Y> SingularAttribute<? super X, Y> getSingularAttribute(String nameClass<Y> type);

Return the single-valued attribute declared by the managed type that corresponds to the specified name and Java type.

Parameters:
name the name of the represented attribute
type the type of the represented attribute
Returns:
declared single-valued attribute of the given name and type
Throws:
java.lang.IllegalArgumentException if attribute of the given name and type is not declared in the managed type
 
 	<Y> SingularAttribute<X, Y> getDeclaredSingularAttribute(String nameClass<Y> type);

Return the single-valued attributes of the managed type. Returns empty set if the managed type has no single-valued attributes.

Returns:
single-valued attributes
 
Return the single-valued attributes declared by the managed type. Returns empty set if the managed type has no declared single-valued attributes.

Returns:
declared single-valued attributes
 
Return the Collection-valued attribute of the managed type that corresponds to the specified name and Java element type.

Parameters:
name the name of the represented attribute
elementType the element type of the represented attribute
Returns:
CollectionAttribute of the given name and element type
Throws:
java.lang.IllegalArgumentException if attribute of the given name and type is not present in the managed type
	<E> CollectionAttribute<? super X, E> getCollection(String nameClass<E> elementType);

Return the Collection-valued attribute declared by the managed type that corresponds to the specified name and Java element type.

Parameters:
name the name of the represented attribute
elementType the element type of the represented attribute
Returns:
declared CollectionAttribute of the given name and element type
Throws:
java.lang.IllegalArgumentException if attribute of the given name and type is not declared in the managed type
	<E> CollectionAttribute<X, E> getDeclaredCollection(String nameClass<E> elementType);

Return the Set-valued attribute of the managed type that corresponds to the specified name and Java element type.

Parameters:
name the name of the represented attribute
elementType the element type of the represented attribute
Returns:
SetAttribute of the given name and element type
Throws:
java.lang.IllegalArgumentException if attribute of the given name and type is not present in the managed type
	<E> SetAttribute<? super X, E> getSet(String nameClass<E> elementType);

Return the Set-valued attribute declared by the managed type that corresponds to the specified name and Java element type.

Parameters:
name the name of the represented attribute
elementType the element type of the represented attribute
Returns:
declared SetAttribute of the given name and element type
Throws:
java.lang.IllegalArgumentException if attribute of the given name and type is not declared in the managed type
	<E> SetAttribute<X, E> getDeclaredSet(String nameClass<E> elementType);

Return the List-valued attribute of the managed type that corresponds to the specified name and Java element type.

Parameters:
name the name of the represented attribute
elementType the element type of the represented attribute
Returns:
ListAttribute of the given name and element type
Throws:
java.lang.IllegalArgumentException if attribute of the given name and type is not present in the managed type
	<E> ListAttribute<? super X, E> getList(String nameClass<E> elementType);

Return the List-valued attribute declared by the managed type that corresponds to the specified name and Java element type.

Parameters:
name the name of the represented attribute
elementType the element type of the represented attribute
Returns:
declared ListAttribute of the given name and element type
Throws:
java.lang.IllegalArgumentException if attribute of the given name and type is not declared in the managed type
	<E> ListAttribute<X, E> getDeclaredList(String nameClass<E> elementType);

Return the Map-valued attribute of the managed type that corresponds to the specified name and Java key and value types.

Parameters:
name the name of the represented attribute
keyType the key type of the represented attribute
valueType the value type of the represented attribute
Returns:
MapAttribute of the given name and key and value types
Throws:
java.lang.IllegalArgumentException if attribute of the given name and type is not present in the managed type
	<K, V> MapAttribute<? super X, K, V> getMap(String nameClass<K> keyTypeClass<V> valueType);

Return the Map-valued attribute declared by the managed type that corresponds to the specified name and Java key and value types.

Parameters:
name the name of the represented attribute
keyType the key type of the represented attribute
valueType the value type of the represented attribute
Returns:
declared MapAttribute of the given name and key and value types
Throws:
java.lang.IllegalArgumentException if attribute of the given name and type is not declared in the managed type
	<K, V> MapAttribute<X, K, V> getDeclaredMap(String nameClass<K> keyTypeClass<V> valueType);

Return all multi-valued attributes (Collection-, Set-, List-, and Map-valued attributes) of the managed type. Returns empty set if the managed type has no multi-valued attributes.

Returns:
Collection-, Set-, List-, and Map-valued attributes
	Set<PluralAttribute<? super X, ?, ?>> getPluralAttributes();

Return all multi-valued attributes (Collection-, Set-, List-, and Map-valued attributes) declared by the managed type. Returns empty set if the managed type has no declared multi-valued attributes.

Returns:
declared Collection-, Set-, List-, and Map-valued attributes
//String-based:
Return the attribute of the managed type that corresponds to the specified name.

Parameters:
name the name of the represented attribute
Returns:
attribute with given name
Throws:
java.lang.IllegalArgumentException if attribute of the given name is not present in the managed type
	Attribute<? super X, ?> getAttribute(String name);

Return the attribute declared by the managed type that corresponds to the specified name.

Parameters:
name the name of the represented attribute
Returns:
attribute with given name
Throws:
java.lang.IllegalArgumentException if attribute of the given name is not declared in the managed type
Return the single-valued attribute of the managed type that corresponds to the specified name.

Parameters:
name the name of the represented attribute
Returns:
single-valued attribute with the given name
Throws:
java.lang.IllegalArgumentException if attribute of the given name is not present in the managed type
Return the single-valued attribute declared by the managed type that corresponds to the specified name.

Parameters:
name the name of the represented attribute
Returns:
declared single-valued attribute of the given name
Throws:
java.lang.IllegalArgumentException if attribute of the given name is not declared in the managed type
Return the Collection-valued attribute of the managed type that corresponds to the specified name.

Parameters:
name the name of the represented attribute
Returns:
CollectionAttribute of the given name
Throws:
java.lang.IllegalArgumentException if attribute of the given name is not present in the managed type
	CollectionAttribute<? super X, ?> getCollection(String name);

Return the Collection-valued attribute declared by the managed type that corresponds to the specified name.

Parameters:
name the name of the represented attribute
Returns:
declared CollectionAttribute of the given name
Throws:
java.lang.IllegalArgumentException if attribute of the given name is not declared in the managed type
Return the Set-valued attribute of the managed type that corresponds to the specified name.

Parameters:
name the name of the represented attribute
Returns:
SetAttribute of the given name
Throws:
java.lang.IllegalArgumentException if attribute of the given name is not present in the managed type
	SetAttribute<? super X, ?> getSet(String name);

Return the Set-valued attribute declared by the managed type that corresponds to the specified name.

Parameters:
name the name of the represented attribute
Returns:
declared SetAttribute of the given name
Throws:
java.lang.IllegalArgumentException if attribute of the given name is not declared in the managed type
Return the List-valued attribute of the managed type that corresponds to the specified name.

Parameters:
name the name of the represented attribute
Returns:
ListAttribute of the given name
Throws:
java.lang.IllegalArgumentException if attribute of the given name is not present in the managed type
	ListAttribute<? super X, ?> getList(String name);

Return the List-valued attribute declared by the managed type that corresponds to the specified name.

Parameters:
name the name of the represented attribute
Returns:
declared ListAttribute of the given name
Throws:
java.lang.IllegalArgumentException if attribute of the given name is not declared in the managed type
Return the Map-valued attribute of the managed type that corresponds to the specified name.

Parameters:
name the name of the represented attribute
Returns:
MapAttribute of the given name
Throws:
java.lang.IllegalArgumentException if attribute of the given name is not present in the managed type
	MapAttribute<? super X, ?, ?> getMap(String name);

Return the Map-valued attribute declared by the managed type that corresponds to the specified name.

Parameters:
name the name of the represented attribute
Returns:
declared MapAttribute of the given name
Throws:
java.lang.IllegalArgumentException if attribute of the given name is not declared in the managed type
New to GrepCode? Check out our FAQ X