docs: @SneakyThrows
      public static DataSource newDataSource(final AbstractJpaProperties jpaProperties) {
          val dataSourceName = jpaProperties.getDataSourceName();
          val proxyDataSource = jpaProperties.isDataSourceProxy();
  
          if (StringUtils.isNotBlank(dataSourceName)) {
              try {
                  val dsLookup = new JndiDataSourceLookup();
                  dsLookup.setResourceRef(false);
                  val containerDataSource = dsLookup.getDataSource(dataSourceName);
                  if (!proxyDataSource) {
                      return containerDataSource;
                  }
                  return new DataSourceProxy(containerDataSource);
              } catch (final DataSourceLookupFailureException e) {
                  LOGGER.warn("Lookup of datasource [{}] failed due to [{}] falling back to configuration via JPA properties.", dataSourceName, e.getMessage());
              }
          }
  
          val bean = new HikariDataSource();
          if (StringUtils.isNotBlank(jpaProperties.getDriverClass())) {
              bean.setDriverClassName(jpaProperties.getDriverClass());
          }
          bean.setJdbcUrl(jpaProperties.getUrl());
          bean.setUsername(jpaProperties.getUser());
          bean.setPassword(jpaProperties.getPassword());
          bean.setLoginTimeout((int) Beans.newDuration(jpaProperties.getPool().getMaxWait()).getSeconds());
          bean.setMaximumPoolSize(jpaProperties.getPool().getMaxSize());
          bean.setMinimumIdle(jpaProperties.getPool().getMinSize());
          bean.setIdleTimeout((int) Beans.newDuration(jpaProperties.getIdleTimeout()).toMillis());
          bean.setLeakDetectionThreshold(jpaProperties.getLeakThreshold());
          bean.setInitializationFailTimeout(jpaProperties.getFailFastTimeout());
          bean.setIsolateInternalQueries(jpaProperties.isIsolateInternalQueries());
          bean.setConnectionTestQuery(jpaProperties.getHealthQuery());
          bean.setAllowPoolSuspension(jpaProperties.getPool().isSuspension());
          bean.setAutoCommit(jpaProperties.isAutocommit());
          bean.setValidationTimeout(jpaProperties.getPool().getTimeoutMillis());
          return bean;
      }