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
ConstructorDescriptionCreates a newMappingRelationalEntityInformation
for the givenRelationalPersistentEntity
.MappingRelationalEntityInformation
(RelationalPersistentEntity<T> entity, Class<ID> fallbackIdType) Creates a newMappingRelationalEntityInformation
for the givenRelationalPersistentEntity
and fallback identifier type.MappingRelationalEntityInformation
(RelationalPersistentEntity<T> entity, String customTableName) Creates a newMappingRelationalEntityInformation
for the givenRelationalPersistentEntity
and custom table name. -
Method Summary
Modifier and TypeMethodDescriptionReturns 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 Details
-
MappingRelationalEntityInformation
Creates a newMappingRelationalEntityInformation
for the givenRelationalPersistentEntity
.- Parameters:
entity
- must not be null.
-
MappingRelationalEntityInformation
public MappingRelationalEntityInformation(RelationalPersistentEntity<T> entity, @Nullable Class<ID> fallbackIdType) Creates a newMappingRelationalEntityInformation
for the givenRelationalPersistentEntity
and fallback identifier type.- Parameters:
entity
- must not be null.fallbackIdType
- can be null.
-
MappingRelationalEntityInformation
public MappingRelationalEntityInformation(RelationalPersistentEntity<T> entity, String customTableName) Creates a newMappingRelationalEntityInformation
for the givenRelationalPersistentEntity
and custom table name.- Parameters:
entity
- must not be null.customTableName
- can be null.
-
-
Method Details
-
getTableName
Description copied from interface:RelationalEntityInformation
Returns the name of the table the entity shall be persisted to.- Specified by:
getTableName
in interfaceRelationalEntityInformation<T,
ID> - Returns:
-
getIdAttribute
-
getIdType
- Specified by:
getIdType
in interfaceEntityInformation<T,
ID> - Overrides:
getIdType
in classPersistentEntityInformation<T,
ID>
-