1 | super.afterSessionFactoryBuilt( sfi );↵ | | 1 | super.afterSessionFactoryBuilt( sfi );
↵
|
2 | Session session = null;↵ | | 2 | Session session = null;
↵
|
3 | try {↵ | | 3 | try {
↵
|
4 | session = sfi.openSession();↵ | | 4 | session = sfi.openSession();
↵
|
5 | Statement st = session.connection().createStatement();↵ | | 5 | Statement stat = session.connection().createStatement();
↵
|
6 | try {↵ | | 6 | ↵
|
7 | st.execute( "drop table Point");↵ | | 7 | stat.execute("CREATE SCHEMA sb AUTHORIZATION DBA ");
↵
|
8 | }↵ | | 8 | ↵
|
9 | catch( Throwable ignore ) {↵ | | |
|
10 | // ignore↵ | | |
|
11 | }↵ | | 9 | stat.execute(" CREATE SCHEMA sa AUTHORIZATION DBA ");
↵
|
12 | st.execute("create table Point (\"x\" number(19,2) not null, \"y\" number(19,2) not null, description varchar2(255) )"↵ | | 10 | stat.execute(" CREATE TABLE \"SA\".\"Team\" (test INTEGER) ");↵
|
13 | );↵ | | 11 | stat.close();
↵
|
14 | }↵ | | 12 | }
↵
|
15 | catch ( SQLException e ) {↵ | | 13 | catch ( SQLException e ) {
↵
|
16 | throw new RuntimeException( "Unable to build actual schema : " + e.getMessage() );↵ | | 14 | throw new RuntimeException( "could not prepare additional schemas" );
↵
|
17 | }↵ | | 15 | }
↵
|
18 | finally {↵ | | 16 | finally {
↵
|
19 | if ( session != null ) {↵ | | 17 | if ( session != null ) {
↵
|
20 | try {↵ | | 18 | try {
↵
|
21 | session.close();↵ | | 19 | session.close();
↵
|
22 | }↵ | | 20 | }
↵
|
23 | catch( Throwable ignore ) {↵ | | 21 | catch( Throwable ignore ) {↵
|
24 | // ignore↵ | | 22 |
↵
|
25 | }↵ | | 23 | }
↵
|
26 | }↵ | | 24 | }
↵
|
27 | } | | 25 | }
|