@ Transactional ( readOnly = true , propagation = Propagation . REQUIRED ) public String getDatabaseSchemaVersion ( ) { try { List < Map < String , Object > > result = getJdbcTemplate ( ) . queryForList ( "SELECT \"value\" FROM repository_metadata WHERE \"name\"='schema-version'" ) ; String schema = result . size ( ) > 0 ? ( String ) result . get ( 0 ) . get ( "value" ) : "" ; return schema ; } catch ( DataAccessException ex ) { String error = "Wrong database schema (too old to get the exact number), " + "please initialize the database." ; log . error ( error ) ; } return "" ; }
Get the real schema name and version as used by the database .