@Test public void testHikariSettings() { HashMap<String, String> settings = new HashMap<>(); settings.put("a", "b"); settings.put("hibernate.hikari.minimumIdle", "1000"); PoolConfiguration configuration = PoolConfiguration.builder().maxPoolSize(99).build(); HibernateUtils.addHikariSettings(settings, configuration); assertEquals(settings.size(), 5); assertEquals(settings.get("hibernate.hikari.minimumIdle"), "1000"); assertEquals(settings.get("hibernate.hikari.maximumPoolSize"), String.valueOf(configuration.getMaxPoolSize())); }
static void addHikariSettings(Map<String, String> settings, PoolConfiguration configuration) { settings.putIfAbsent("hibernate.hikari.connectionTimeout", String.valueOf(configuration.getConnectionTimeout())); settings.putIfAbsent("hibernate.hikari.minimumIdle", String.valueOf(configuration.getMinPoolSize())); settings.putIfAbsent("hibernate.hikari.maximumPoolSize", String.valueOf(configuration.getMaxPoolSize())); settings.putIfAbsent("hibernate.hikari.idleTimeout", String.valueOf(configuration.getIdleTimeout())); }
HibernateUtils { static void addHikariSettings(Map<String, String> settings, PoolConfiguration configuration) { settings.putIfAbsent("hibernate.hikari.connectionTimeout", String.valueOf(configuration.getConnectionTimeout())); settings.putIfAbsent("hibernate.hikari.minimumIdle", String.valueOf(configuration.getMinPoolSize())); settings.putIfAbsent("hibernate.hikari.maximumPoolSize", String.valueOf(configuration.getMaxPoolSize())); settings.putIfAbsent("hibernate.hikari.idleTimeout", String.valueOf(configuration.getIdleTimeout())); } }
HibernateUtils { static void addHikariSettings(Map<String, String> settings, PoolConfiguration configuration) { settings.putIfAbsent("hibernate.hikari.connectionTimeout", String.valueOf(configuration.getConnectionTimeout())); settings.putIfAbsent("hibernate.hikari.minimumIdle", String.valueOf(configuration.getMinPoolSize())); settings.putIfAbsent("hibernate.hikari.maximumPoolSize", String.valueOf(configuration.getMaxPoolSize())); settings.putIfAbsent("hibernate.hikari.idleTimeout", String.valueOf(configuration.getIdleTimeout())); } private  HibernateUtils(); }
HibernateUtils { static void addHikariSettings(Map<String, String> settings, PoolConfiguration configuration) { settings.putIfAbsent("hibernate.hikari.connectionTimeout", String.valueOf(configuration.getConnectionTimeout())); settings.putIfAbsent("hibernate.hikari.minimumIdle", String.valueOf(configuration.getMinPoolSize())); settings.putIfAbsent("hibernate.hikari.maximumPoolSize", String.valueOf(configuration.getMaxPoolSize())); settings.putIfAbsent("hibernate.hikari.idleTimeout", String.valueOf(configuration.getIdleTimeout())); } private  HibernateUtils(); static StandardServiceRegistry createServiceRegistry(@NonNull Map<String, String> settings,
      @NonNull PoolConfiguration configuration); static SessionFactory getSessionFactory(@NonNull MetadataSources sources); static FlushMode setFlushMode(@NonNull Session session,
      @NonNull TransactionDefinition transactionDefinition); static void resetFlushMode(@NonNull Session session, FlushMode flushMode); }
HibernateUtils { static void addHikariSettings(Map<String, String> settings, PoolConfiguration configuration) { settings.putIfAbsent("hibernate.hikari.connectionTimeout", String.valueOf(configuration.getConnectionTimeout())); settings.putIfAbsent("hibernate.hikari.minimumIdle", String.valueOf(configuration.getMinPoolSize())); settings.putIfAbsent("hibernate.hikari.maximumPoolSize", String.valueOf(configuration.getMaxPoolSize())); settings.putIfAbsent("hibernate.hikari.idleTimeout", String.valueOf(configuration.getIdleTimeout())); } private  HibernateUtils(); static StandardServiceRegistry createServiceRegistry(@NonNull Map<String, String> settings,
      @NonNull PoolConfiguration configuration); static SessionFactory getSessionFactory(@NonNull MetadataSources sources); static FlushMode setFlushMode(@NonNull Session session,
      @NonNull TransactionDefinition transactionDefinition); static void resetFlushMode(@NonNull Session session, FlushMode flushMode);  }