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

    Constructors
    Constructor
    Description
    Creates a new AssociationAttributeConverter for the given Identifier type.
  • Method Summary

    Modifier and Type
    Method
    Description
    instantiate(org.hibernate.metamodel.spi.ValueAccess access, org.hibernate.engine.spi.SessionFactoryImplementor factory)
     
    boolean
    isInstance(Object object, org.hibernate.engine.spi.SessionFactoryImplementor sessionFactory)
     
    boolean
    isSameClass(Object object, org.hibernate.engine.spi.SessionFactoryImplementor sessionFactory)
     

    Methods inherited from class java.lang.Object

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

    • RecordInstantiator

      public RecordInstantiator(Class<?> type)
      Creates a new AssociationAttributeConverter for the given Identifier type.
      Parameters:
      type - must not be null.
  • Method Details

    • isInstance

      public boolean isInstance(Object object, org.hibernate.engine.spi.SessionFactoryImplementor sessionFactory)
      Specified by:
      isInstance in interface org.hibernate.metamodel.spi.Instantiator
    • isSameClass

      public boolean isSameClass(Object object, org.hibernate.engine.spi.SessionFactoryImplementor sessionFactory)
      Specified by:
      isSameClass in interface org.hibernate.metamodel.spi.Instantiator
    • instantiate

      public Object instantiate(org.hibernate.metamodel.spi.ValueAccess access, org.hibernate.engine.spi.SessionFactoryImplementor factory)
      Specified by:
      instantiate in interface org.hibernate.metamodel.spi.EmbeddableInstantiator