Spring Data JPA

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

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

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

Extension of EntityInformation to capture additional 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
 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.jpa.repository.support.JpaEntityMetadata
getEntityName
 
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:

Spring Data JPA

Copyright © 2011-2014–2014 Pivotal Software, Inc.. All rights reserved.