org.springframework.data.repository.core.support

## Class PersistentEntityInformation<T,ID>

- java.lang.Object
- - org.springframework.data.repository.core.support.PersistentEntityInformation<T,ID>

All Implemented Interfaces:
  EntityInformation<T,ID>, EntityMetadata<T>

    public class PersistentEntityInformation<T,ID>
    extends Object
    implements EntityInformation<T,ID>

`EntityInformation` implementation that uses a `PersistentEntity` to obtain id type information and uses a `IdentifierAccessor` to access the property value if requested.

Author:
  Oliver Gierke, Christoph Strobl

### Constructor Summary

Constructors
Constructor and Description
`PersistentEntityInformation(PersistentEntity<T,? extends PersistentProperty<?>> persistentEntity)`

### Method Summary

All Methods Instance Methods Concrete Methods
`ID` `getId(T entity)` Returns the id of the given entity or null if none can be obtained.
`Class<ID>` `getIdType()` Returns the type of the id of the entity.
`Class<T>` `getJavaType()` Returns the actual domain class type.
`boolean` `isNew(T entity)` Returns whether the given entity is considered to be new.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface org.springframework.data.repository.core.EntityInformation

`getRequiredId`

### Constructor Detail

#### PersistentEntityInformation

    public PersistentEntityInformation(PersistentEntity<T,? extends PersistentProperty<?>> persistentEntity)

### Method Detail

#### isNew

    public boolean isNew(T entity)

Description copied from interface: `EntityInformation`
Returns whether the given entity is considered to be new.

Specified by:
  `isNew` in interface `EntityInformation<T,ID>`
Parameters:
  `entity` - must never be null
Returns:

#### getId

    @Nullable
    public ID getId(T entity)

Description copied from interface: `EntityInformation`
Returns the id of the given entity or null if none can be obtained.

Specified by:
  `getId` in interface `EntityInformation<T,ID>`
Parameters:
  `entity` - must never be null
Returns:

#### getJavaType

    public Class<T> getJavaType()

Description copied from interface: `EntityMetadata`
Returns the actual domain class type.

Specified by:
  `getJavaType` in interface `EntityMetadata<T>`
Returns:

#### getIdType

    public Class<ID> getIdType()

Description copied from interface: `EntityInformation`
Returns the type of the id of the entity.

Specified by:
  `getIdType` in interface `EntityInformation<T,ID>`
Returns: