Java Code Examples for org.springframework.boot.jdbc.EmbeddedDatabaseConnection#isEmbedded()
The following examples show how to use
org.springframework.boot.jdbc.EmbeddedDatabaseConnection#isEmbedded() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DatabaseResourceReleaser.java From multitenant with Apache License 2.0 | 5 votes |
@Override public void release(Organization organization) { entityManagerFactoryService.removeEntityManagerFactory(organization); EntityManager em = EntityManagerFactoryUtils.getTransactionalEntityManager(emf); if (!EmbeddedDatabaseConnection.isEmbedded(properties.determineDriverClassName())) { em.createNativeQuery("drop database " + organization.getId()).executeUpdate(); } }
Example 2
Source File: HibernateDefaultDdlAutoProvider.java From multitenant with Apache License 2.0 | 5 votes |
public String getDefaultDdlAuto(DataSource dataSource) { if (!EmbeddedDatabaseConnection.isEmbedded(dataSource)) { return "none"; } SchemaManagement schemaManagement = getSchemaManagement(dataSource); if (SchemaManagement.MANAGED.equals(schemaManagement)) { return "none"; } return "create-drop"; }