Skip to content

Instantly share code, notes, and snippets.

@jirkafm
Created August 10, 2020 08:38
Show Gist options
  • Save jirkafm/f699e657469fc6648f8ec9daaef711f2 to your computer and use it in GitHub Desktop.
Save jirkafm/f699e657469fc6648f8ec9daaef711f2 to your computer and use it in GitHub Desktop.
H2 - get all table names from current schema (Spring JPA)
final Query query = testEntityManager.getEntityManager()
.createNativeQuery("SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = SCHEMA()");
final List result = query.getResultList();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment