Class JpaMetamodel

java.lang.Object
org.springframework.data.jpa.util.JpaMetamodel

public class JpaMetamodel extends Object
Wrapper around the JPA Metamodel to be able to apply some fixes against bugs in provider implementations.
Author:
Oliver Gierke, Mark Paluch, Sylvère Richard
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns whether the given type is managed by the backing JPA Metamodel.
    boolean
    isMappedType(Class<?> entity)
    Returns whether the given type is considered a mapped type, i.e. an actually JPA persisted entity, mapped superclass or native JPA embeddable.
    boolean
    isSingleIdAttribute(Class<?> entity, String name, Class<?> attributeType)
    Returns whether the attribute of given name and type is the single identifier attribute of the given entity.
    of(jakarta.persistence.metamodel.Metamodel metamodel)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • of

      public static JpaMetamodel of(jakarta.persistence.metamodel.Metamodel metamodel)
    • isJpaManaged

      public boolean isJpaManaged(Class<?> type)
      Returns whether the given type is managed by the backing JPA Metamodel.
      Parameters:
      type - must not be null.
      Returns:
    • isSingleIdAttribute

      public boolean isSingleIdAttribute(Class<?> entity, String name, Class<?> attributeType)
      Returns whether the attribute of given name and type is the single identifier attribute of the given entity.
      Parameters:
      entity - must not be null.
      name - must not be null.
      attributeType - must not be null.
      Returns:
    • isMappedType

      public boolean isMappedType(Class<?> entity)
      Returns whether the given type is considered a mapped type, i.e. an actually JPA persisted entity, mapped superclass or native JPA embeddable.
      Parameters:
      entity - must not be null.
      Returns: