@AggrEventsTransactional @Override public void preUpdate() { JdbcUtils.dropTableIfExists(this.jdbcOperations, "UP_LOGIN_EVENT_AGGREGATE__UIDS"); JdbcUtils.dropTableIfExists(this.jdbcOperations, "UP_LOGIN_EVENT_AGGREGATE"); JdbcUtils.dropTableIfExists(this.jdbcOperations, "UP_EVENT_AGGR_CONF_INTRVL_EXC"); JdbcUtils.dropTableIfExists(this.jdbcOperations, "UP_EVENT_AGGR_CONF_INTRVL_INC"); }
protected boolean isReady() { boolean r = this.ready; if (!r) { r = JdbcUtils.doesTableExist(this.jdbcOperations, Table.NAME); if (r) { this.ready = r; } } return r; } }
/** @see #dropTableIfExists(JdbcOperations, String, Function) */ public static final void dropTableIfExists(JdbcOperations jdbcOperations, final String table) { dropTableIfExists(jdbcOperations, table, Functions.<JdbcOperations>identity()); } }
protected boolean isReady() { boolean r = this.ready; if (!r) { r = JdbcUtils.doesTableExist(this.jdbcOperations, Table.NAME); if (r) { this.ready = r; } } return r; } }
/** @see #dropTableIfExists(JdbcOperations, String, Function) */ public static final void dropTableIfExists(JdbcOperations jdbcOperations, final String table) { dropTableIfExists(jdbcOperations, table, Functions.<JdbcOperations>identity()); } }
/** * Check if the named table exists, if it does drop it, calling the preDropCallback first * * @param jdbcOperations {@link JdbcOperations} used to check if the table exists and execute * the drop * @param table The name of the table to drop, case insensitive * @param preDropCallback The callback to execute immediately before the table is dropped * @return The result returned from the callback */ public static final <T> T dropTableIfExists( JdbcOperations jdbcOperations, final String table, final Function<JdbcOperations, T> preDropCallback) { LOGGER.info("Dropping table: " + table); final boolean tableExists = doesTableExist(jdbcOperations, table); if (tableExists) { final T ret = preDropCallback.apply(jdbcOperations); jdbcOperations.execute("DROP TABLE " + table); return ret; } return null; }
@PortalTransactional @Override public void preUpdate() { JdbcUtils.dropTableIfExists(this.jdbcOperations, "UP_MUTEX"); }
/** * Check if the named table exists, if it does drop it, calling the preDropCallback first * * @param jdbcOperations {@link JdbcOperations} used to check if the table exists and execute * the drop * @param table The name of the table to drop, case insensitive * @param preDropCallback The callback to execute immediately before the table is dropped * @return The result returned from the callback */ public static final <T> T dropTableIfExists( JdbcOperations jdbcOperations, final String table, final Function<JdbcOperations, T> preDropCallback) { LOGGER.info("Dropping table: " + table); final boolean tableExists = doesTableExist(jdbcOperations, table); if (tableExists) { final T ret = preDropCallback.apply(jdbcOperations); jdbcOperations.execute("DROP TABLE " + table); return ret; } return null; }