Spring Data JPA

org.springframework.data.jpa.repository.support
Interface JpaEntityInformation<T,ID extends Serializable>

All Superinterfaces:
EntityInformation<T,ID>, EntityMetadata<T>
All Known Implementing Classes:
JpaEntityInformationSupport, JpaMetamodelEntityInformation, JpaPersistableEntityInformation

public interface JpaEntityInformation<T,ID extends Serializable>
extends EntityInformation<T,ID>

Extension of EntityInformation to capture aditional JPA specific information about entities.

Author:
Oliver Gierke, Thomas Darimont

Method Summary
 Object getCompositeIdAttributeValue(Serializable id, String idAttribute)
          Extracts the value for the given id attribute from a composite id
 String getEntityName()
          Returns the JPA entity name.
 javax.persistence.metamodel.SingularAttribute<? super T,?> getIdAttribute()
          Returns the id attribute of the entity.
 Iterable<String> getIdAttributeNames()
          Returns the attribute names of the id attributes.
 boolean hasCompositeId()
          Returns true if the entity has a composite id
 
Methods inherited from interface org.springframework.data.repository.core.EntityInformation
getId, getIdType, isNew
 
Methods inherited from interface org.springframework.data.repository.core.EntityMetadata
getJavaType
 

Method Detail

getIdAttribute

javax.persistence.metamodel.SingularAttribute<? super T,?> getIdAttribute()
Returns the id attribute of the entity.

Returns:

hasCompositeId

boolean hasCompositeId()
Returns true if the entity has a composite id

Returns:

getIdAttributeNames

Iterable<String> getIdAttributeNames()
Returns the attribute names of the id attributes. If the entity has a composite id, then all id attribute names are returned. If the entity has a single id attribute then this single attribute name is returned.

Returns:

getCompositeIdAttributeValue

Object getCompositeIdAttributeValue(Serializable id,
                                    String idAttribute)
Extracts the value for the given id attribute from a composite id

Parameters:
id -
idAttribute -
Returns:

getEntityName

String getEntityName()
Returns the JPA entity name.

Returns:

Spring Data JPA

Copyright © 2011-2013-2013 SpringSource. All Rights Reserved.