Class JpaPersistableEntityInformation<T extends org.springframework.data.domain.Persistable<ID>,ID>

java.lang.Object
org.springframework.data.repository.core.support.AbstractEntityInformation<T,ID>
All Implemented Interfaces:
JpaEntityMetadata<T>, JpaEntityInformation<T,ID>, org.springframework.data.repository.core.EntityInformation<T,ID>, org.springframework.data.repository.core.EntityMetadata<T>

public class JpaPersistableEntityInformation<T extends org.springframework.data.domain.Persistable<ID>,ID> extends JpaMetamodelEntityInformation<T,ID>
Extension of JpaMetamodelEntityInformation that consideres methods of Persistable to lookup the id.
Author:
Oliver Gierke, Christoph Strobl, Mark Paluch
  • Constructor Details

    • JpaPersistableEntityInformation

      public JpaPersistableEntityInformation(Class<T> domainClass, jakarta.persistence.metamodel.Metamodel metamodel, jakarta.persistence.PersistenceUnitUtil persistenceUnitUtil)
      Creates a new JpaPersistableEntityInformation for the given domain class and Metamodel.
      Parameters:
      domainClass - must not be null.
      metamodel - must not be null.
      persistenceUnitUtil - must not be null.
  • Method Details

    • isNew

      public boolean isNew(T entity)
      Specified by:
      isNew in interface org.springframework.data.repository.core.EntityInformation<T extends org.springframework.data.domain.Persistable<ID>,ID>
      Overrides:
      isNew in class JpaMetamodelEntityInformation<T extends org.springframework.data.domain.Persistable<ID>,ID>
    • getId

      @Nullable public ID getId(T entity)
      Specified by:
      getId in interface org.springframework.data.repository.core.EntityInformation<T extends org.springframework.data.domain.Persistable<ID>,ID>
      Overrides:
      getId in class JpaMetamodelEntityInformation<T extends org.springframework.data.domain.Persistable<ID>,ID>