org.springframework.data.relational.repository.support

## Class MappingRelationalEntityInformation<T,ID>

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

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

    public class MappingRelationalEntityInformation<T,ID>
    extends PersistentEntityInformation<T,ID>
    implements RelationalEntityInformation<T,ID>

`RelationalEntityInformation` implementation using a `RelationalPersistentEntity` instance to lookup the necessary information. Can be configured with a custom table name.

Entity types that do not declare an explicit Id type fall back to `Long` as Id type.

Author:
  Mark Paluch

### Constructor Summary

Constructors
Constructor and Description
`MappingRelationalEntityInformation(RelationalPersistentEntity<T> entity)` Creates a new `MappingRelationalEntityInformation` for the given `RelationalPersistentEntity`.
`MappingRelationalEntityInformation(RelationalPersistentEntity<T> entity, Class<ID> fallbackIdType)` Creates a new `MappingRelationalEntityInformation` for the given `RelationalPersistentEntity` and fallback identifier type.
`MappingRelationalEntityInformation(RelationalPersistentEntity<T> entity, String customTableName)` Creates a new `MappingRelationalEntityInformation` for the given `RelationalPersistentEntity` and custom table name.

### Method Summary

All Methods Instance Methods Concrete Methods
`String` `getIdAttribute()`
`Class<ID>` `getIdType()`
`SqlIdentifier` `getTableName()` Returns the name of the table the entity shall be persisted to.

### Methods inherited from class org.springframework.data.repository.core.support.PersistentEntityInformation

`getId, getJavaType, isNew`

### 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

`getId, getRequiredId, isNew`

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

`getJavaType`

### Constructor Detail

#### MappingRelationalEntityInformation

    public MappingRelationalEntityInformation(RelationalPersistentEntity<T> entity)

Creates a new `MappingRelationalEntityInformation` for the given `RelationalPersistentEntity`.

Parameters:
  `entity` - must not be null.

#### MappingRelationalEntityInformation

    public MappingRelationalEntityInformation(RelationalPersistentEntity<T> entity,
                                              @Nullable
                                              Class<ID> fallbackIdType)

Creates a new `MappingRelationalEntityInformation` for the given `RelationalPersistentEntity` and fallback identifier type.

Parameters:
  `entity` - must not be null.
  `fallbackIdType` - can be null.

#### MappingRelationalEntityInformation

    public MappingRelationalEntityInformation(RelationalPersistentEntity<T> entity,
                                              String customTableName)

Creates a new `MappingRelationalEntityInformation` for the given `RelationalPersistentEntity` and custom table name.

Parameters:
  `entity` - must not be null.
  `customTableName` - can be null.

### Method Detail

#### getTableName

    public SqlIdentifier getTableName()

Description copied from interface: `RelationalEntityInformation`
Returns the name of the table the entity shall be persisted to.

Specified by:
  `getTableName` in interface `RelationalEntityInformation<T,ID>`
Returns:

#### getIdAttribute

    public String getIdAttribute()

#### getIdType

    public Class<ID> getIdType()

Specified by:
  `getIdType` in interface `EntityInformation<T,ID>`
Overrides:
  `getIdType` in class `PersistentEntityInformation<T,ID>`