Class PojoEntityReference

java.lang.Object
org.hibernate.search.mapper.pojo.common.spi.PojoEntityReference
All Implemented Interfaces:
EntityReference

public final class PojoEntityReference extends Object implements EntityReference
A simple, default implementation for EntityReference for POJO-based mappers.

Should be used instead of custom implementations, whose support is going to be removed in the future.

  • Constructor Details

  • Method Details

    • withDefaultName

      public static EntityReference withDefaultName(Class<?> javaClass, Object id)
    • withName

      public static EntityReference withName(Class<?> javaClass, String entityName, Object id)
    • type

      public Class<?> type()
      Specified by:
      type in interface EntityReference
      Returns:
      The type of the referenced entity.
    • name

      public String name()
      Specified by:
      name in interface EntityReference
      Returns:
      The name of the referenced entity.
    • id

      public Object id()
      Specified by:
      id in interface EntityReference
      Returns:
      The identifier of the referenced entity for Hibernate Search. This is the value of the property used to generate the document ID, which is generally also the entity ID (though depending on the mapping this may be another unique property).
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object