Class HibernateClient

java.lang.Object
me.hsgamer.hscore.database.client.hibernate.HibernateClient
All Implemented Interfaces:
Client<org.hibernate.cfg.Configuration>

public class HibernateClient extends Object implements Client<org.hibernate.cfg.Configuration>
The Hibernate client
  • Constructor Details

    • HibernateClient

      public HibernateClient(Setting setting)
      Create new Hibernate client
      Parameters:
      setting - the setting
  • Method Details

    • getSetting

      public Setting getSetting()
      Description copied from interface: Client
      Get the setting
      Specified by:
      getSetting in interface Client<org.hibernate.cfg.Configuration>
      Returns:
      the setting
    • getOriginal

      public org.hibernate.cfg.Configuration getOriginal()
      Description copied from interface: Client
      Get the original
      Specified by:
      getOriginal in interface Client<org.hibernate.cfg.Configuration>
      Returns:
      the original
    • configure

      public HibernateClient configure(Consumer<org.hibernate.cfg.Configuration> configurationConsumer)
      Configure the configuration
      Parameters:
      configurationConsumer - the consumer
      Returns:
      the client for chaining
    • addEntityClass

      public HibernateClient addEntityClass(Class<?>... clazz)
      Add entity class to the client
      Parameters:
      clazz - the entity class
      Returns:
      the client for chaining
      See Also:
      • Configuration.addAnnotatedClass(Class)
    • buildSessionFactory

      public org.hibernate.SessionFactory buildSessionFactory()
      Build the session factory from the client
      Returns:
      the session factory