Module spring.data.relational
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
ConstructorsConstructorDescriptionCreates a newMappingRelationalEntityInformationfor the givenRelationalPersistentEntity.MappingRelationalEntityInformation(RelationalPersistentEntity<T> entity, Class<ID> fallbackIdType) Creates a newMappingRelationalEntityInformationfor the givenRelationalPersistentEntityand fallback identifier type.MappingRelationalEntityInformation(RelationalPersistentEntity<T> entity, String customTableName) Creates a newMappingRelationalEntityInformationfor the givenRelationalPersistentEntityand 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, isNewMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.data.repository.core.EntityInformation
getId, getRequiredId, isNewMethods inherited from interface org.springframework.data.repository.core.EntityMetadata
getJavaType
-
Constructor Details
-
MappingRelationalEntityInformation
Creates a newMappingRelationalEntityInformationfor the givenRelationalPersistentEntity.- Parameters:
entity- must not be null.
-
MappingRelationalEntityInformation
public MappingRelationalEntityInformation(RelationalPersistentEntity<T> entity, @Nullable Class<ID> fallbackIdType) Creates a newMappingRelationalEntityInformationfor the givenRelationalPersistentEntityand fallback identifier type.- Parameters:
entity- must not be null.fallbackIdType- can be null.
-
MappingRelationalEntityInformation
public MappingRelationalEntityInformation(RelationalPersistentEntity<T> entity, String customTableName) Creates a newMappingRelationalEntityInformationfor the givenRelationalPersistentEntityand custom table name.- Parameters:
entity- must not be null.customTableName- can be null.
-
-
Method Details
-
getTableName
Description copied from interface:RelationalEntityInformationReturns the name of the table the entity shall be persisted to.- Specified by:
getTableNamein interfaceRelationalEntityInformation<T,ID> - Returns:
-
getIdAttribute
-
getIdType
- Specified by:
getIdTypein interfaceEntityInformation<T,ID> - Overrides:
getIdTypein classPersistentEntityInformation<T,ID>
-