import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
class Scratch {
public static void main(String[] args) {
String[] shops = {"DE", "CH", "AT", "NL", "FR", "DK", "ES", "IT", "EN", "SE", "NO", "FI", "PT", "BE", "LU", "RO", "GR", "CZ", "PL", "HU"};
List<String> shopList = Arrays.asList(shops);
Collections.shuffle(shopList);
String result = shopList.stream().limit(5).collect(Collectors.joining("+"));
System.out.println(result);
}
}
@PersistenceContext(unitName = Constants.ADM_ENTITY_MANAGER_FACTORY_NAME)
private EntityManager em;
@Bean(name = Constants.ADM_ENTITY_MANAGER_FACTORY_NAME, destroyMethod = "")
public LocalContainerEntityManagerFactoryBean admEntityManagerFactory() throws NamingException {
LocalContainerEntityManagerFactoryBean em = new LocalContainerEntityManagerFactoryBean();
em.setDataSource(dataSourceAdm());
em.setPackagesToScan(admPackagesToScan);
em.setPersistenceUnitName(Constants.ADM_ENTITY_MANAGER_FACTORY_NAME);
HibernateJpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter();
em.setJpaVendorAdapter(vendorAdapter);
em.setJpaProperties(hibernatePropertiesAdm());
return em;
}
Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
ApplicationContext представляет собой Spring IoC контейнер и необходим для инициализации, настройки и сборки бинов для построения приложения.