-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: verifyStartup kjører nå også på Oracle (#39)
- Loading branch information
Showing
3 changed files
with
35 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
task/src/main/java/no/nav/vedtak/felles/prosesstask/impl/util/DatabaseUtil.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package no.nav.vedtak.felles.prosesstask.impl.util; | ||
|
||
import java.util.Map; | ||
|
||
import javax.persistence.EntityManager; | ||
import javax.persistence.EntityManagerFactory; | ||
|
||
public class DatabaseUtil { | ||
public static boolean isPostgres(EntityManager entityManager) { | ||
EntityManagerFactory emf = entityManager.getEntityManagerFactory(); | ||
Map<String, Object> emfProperties = emf.getProperties(); | ||
String dialect = (String) emfProperties.get("hibernate.dialect"); | ||
return dialect.contains("PostgreSQL"); | ||
} | ||
} |