public static String getObjectScript ( String objectName , boolean multiDb , String dialect , WorkspaceEntry wsEntry ) throws RepositoryConfigurationException , IOException { String scripts = prepareScripts ( wsEntry , dialect ) ; String sql = null ; for ( String query : JDBCUtils . splitWithSQLDelimiter ( scripts ) ) { String q = JDBCUtils . cleanWhitespaces ( query ) ; if ( q . contains ( objectName ) ) { if ( sql != null ) { throw new RepositoryConfigurationException ( "Can't find unique script for object creation. Object name: " + objectName ) ; } sql = q ; } } if ( sql != null ) { return sql ; } throw new RepositoryConfigurationException ( "Script for object creation is not found. Object name: " + objectName ) ; }
Returns SQL script for create objects such as index primary of foreign key .