Class HibernateClient

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

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

    • HibernateClient

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

    • getOriginal

      public org.hibernate.cfg.Configuration getOriginal()
      Description copied from interface: Client
      Get the original
      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