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: IdentifiableType.java 20957 2011-06-13 09:58:51Z stliu $
 
 package javax.persistence.metamodel;
 
 import java.util.Set;

Instances of the type IdentifiableType represent entity or mapped superclass types.

Parameters:
<X> The represented entity or mapped superclass type.
Since:
Java Persistence 2.0
 
 public interface IdentifiableType<X> extends ManagedType<X> {
Return the attribute that corresponds to the id attribute of the entity or mapped superclass.

Parameters:
type the type of the represented id attribute
Returns:
id attribute
Throws:
java.lang.IllegalArgumentException if id attribute of the given type is not present in the identifiable type or if the identifiable type has an id class
 
 	<Y> SingularAttribute<? super X, Y> getId(Class<Y> type);

Return the attribute that corresponds to the id attribute declared by the entity or mapped superclass.

Parameters:
type the type of the represented declared id attribute
Returns:
declared id attribute
Throws:
java.lang.IllegalArgumentException if id attribute of the given type is not declared in the identifiable type or if the identifiable type has an id class
 
 	<Y> SingularAttribute<X, Y> getDeclaredId(Class<Y> type);

Return the attribute that corresponds to the version attribute of the entity or mapped superclass.

Parameters:
type the type of the represented version attribute
Returns:
version attribute
Throws:
java.lang.IllegalArgumentException if version attribute of the given type is not present in the identifiable type
 
 	<Y> SingularAttribute<? super X, Y> getVersion(Class<Y> type);

Return the attribute that corresponds to the version attribute declared by the entity or mapped superclass.

Parameters:
type the type of the represented declared version attribute
Returns:
declared version attribute
Throws:
java.lang.IllegalArgumentException if version attribute of the type is not declared in the identifiable type
 
 	<Y> SingularAttribute<X, Y> getDeclaredVersion(Class<Y> type);

Return the identifiable type that corresponds to the most specific mapped superclass or entity extended by the entity or mapped superclass.

Returns:
supertype of identifiable type or null if no such supertype
 
 	IdentifiableType<? super X> getSupertype();

Whether the identifiable type has a single id attribute. Returns true for a simple id or embedded id; returns false for an idclass.

Returns:
boolean indicating whether the identifiable type has a single id attribute
Whether the identifiable type has a version attribute.

Returns:
boolean indicating whether the identifiable type has a version attribute
Return the attributes corresponding to the id class of the identifiable type.

Returns:
id attributes
Throws:
java.lang.IllegalArgumentException if the identifiable type does not have an id class
Return the type that represents the type of the id.

Returns:
type of id
New to GrepCode? Check out our FAQ X