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 forEntityReferencefor POJO-based mappers.Should be used instead of custom implementations, whose support is going to be removed in the future.
-
-
Constructor Summary
Constructors Constructor Description PojoEntityReference(PojoRawTypeIdentifier<?> typeIdentifier, String name, Object id)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)inthashCode()Objectid()Stringname()StringtoString()Class<?>type()static EntityReferencewithDefaultName(Class<?> javaClass, Object id)static EntityReferencewithName(Class<?> javaClass, String entityName, Object id)
-
-
-
Constructor Detail
-
PojoEntityReference
public PojoEntityReference(PojoRawTypeIdentifier<?> typeIdentifier, String name, Object id)
-
-
Method Detail
-
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:
typein interfaceEntityReference- Returns:
- The type of the referenced entity.
-
name
public String name()
- Specified by:
namein interfaceEntityReference- Returns:
- The name of the referenced entity.
-
id
public Object id()
- Specified by:
idin interfaceEntityReference- 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).
-
-