Package org.jmolecules.spring.hibernate
Class RecordInstantiator
java.lang.Object
org.jmolecules.spring.hibernate.RecordInstantiator
- All Implemented Interfaces:
org.hibernate.metamodel.spi.EmbeddableInstantiator,org.hibernate.metamodel.spi.Instantiator
public class RecordInstantiator
extends Object
implements org.hibernate.metamodel.spi.EmbeddableInstantiator
Hibernate 6 specific
EmbeddableInstantiator that inspects a Record for its RecordComponents
to assemble instances of it in #instantiate(Supplier, SessionFactoryImplementor). To use it directly, declare
a subclass of it invoking RecordInstantiator's constructor with the record type at hand and use that declared
types via EmbeddableInstantiator on the record type.- Author:
- Oliver Drotbohm
-
Constructor Summary
ConstructorsConstructorDescriptionRecordInstantiator(Class<?> type) Creates a newAssociationAttributeConverterfor the givenIdentifiertype. -
Method Summary
Modifier and TypeMethodDescriptioninstantiate(org.hibernate.metamodel.spi.ValueAccess access, org.hibernate.engine.spi.SessionFactoryImplementor factory) booleanisInstance(Object object, org.hibernate.engine.spi.SessionFactoryImplementor sessionFactory) booleanisSameClass(Object object, org.hibernate.engine.spi.SessionFactoryImplementor sessionFactory)
-
Constructor Details
-
RecordInstantiator
Creates a newAssociationAttributeConverterfor the givenIdentifiertype.- Parameters:
type- must not be null.
-
-
Method Details
-
isInstance
public boolean isInstance(Object object, org.hibernate.engine.spi.SessionFactoryImplementor sessionFactory) - Specified by:
isInstancein interfaceorg.hibernate.metamodel.spi.Instantiator
-
isSameClass
public boolean isSameClass(Object object, org.hibernate.engine.spi.SessionFactoryImplementor sessionFactory) - Specified by:
isSameClassin interfaceorg.hibernate.metamodel.spi.Instantiator
-
instantiate
public Object instantiate(org.hibernate.metamodel.spi.ValueAccess access, org.hibernate.engine.spi.SessionFactoryImplementor factory) - Specified by:
instantiatein interfaceorg.hibernate.metamodel.spi.EmbeddableInstantiator
-