/** * {@inheritDoc} */ public int compare(DbFeatureHistory<DbFeature<T>> o1, DbFeatureHistory<DbFeature<T>> o2) { int parentComparison; parentComparison = featureComparator.compare(o1.getFeature(), o2.getFeature()); if (parentComparison != 0) { return parentComparison; } return o1.getVersion() - o2.getVersion(); } }
/** * Creates a new instance. * * @param dbCtx * The database context to use for all database access. */ public PostgresqlIdentityValueLoader(DatabaseContext dbCtx) { this.dbCtx = dbCtx; statementContainer = new ReleasableStatementContainer(); }
/** * Updates the database type. * * @param property * The database type property. */ public void setDbType(String property) { this.dbType = DatabaseType.fromString(property); }
/** * {@inheritDoc} */ @Override public void process(DbFeature<T> data, ResultSet resultSet) throws SQLException { int sequence; // Get the entity sequence number. sequence = resultSet.getInt("sequence_id"); listener.process(new DbOrderedFeature<T>(data.getEntityId(), data.getFeature(), sequence), resultSet); } }
/** * {@inheritDoc} */ @Override public void process(T data, ResultSet resultSet) throws SQLException { int version; // Get the entity version. version = resultSet.getInt("version"); listener.process(new DbFeatureHistory<T>(data, version), resultSet); } }
/** * {@inheritDoc} */ @Override public void close() { statementContainer.close(); } }
/** * Returns the database type currently in use. This should only be used when it is not possible * to write database agnostic statements. * * @return The database type. */ public DatabaseType getDatabaseType() { return loginCredentials.getDbType(); }
/** * {@inheritDoc} */ @Override public void process(DbFeature<T> data, ResultSet resultSet) throws SQLException { int sequence; // Get the entity sequence number. sequence = resultSet.getInt("sequence_id"); listener.process(new DbOrderedFeature<T>(data.getEntityId(), data.getFeature(), sequence), resultSet); } }
/** * {@inheritDoc} */ public int compare(DbFeatureHistory<DbFeature<T>> o1, DbFeatureHistory<DbFeature<T>> o2) { int parentComparison; parentComparison = featureComparator.compare(o1.getFeature(), o2.getFeature()); if (parentComparison != 0) { return parentComparison; } return o1.getVersion() - o2.getVersion(); } }
/** * {@inheritDoc} */ @Override public void process(T data, ResultSet resultSet) throws SQLException { int version; // Get the entity version. version = resultSet.getInt("version"); listener.process(new DbFeatureHistory<T>(data, version), resultSet); } }
/** * {@inheritDoc} */ @Override public void close() { statementContainer.close(); } }
/** * Returns the database type currently in use. This should only be used when it is not possible * to write database agnostic statements. * * @return The database type. */ public DatabaseType getDatabaseType() { return loginCredentials.getDbType(); }
/** * Creates a new instance. * * @param dbCtx * The database context to use for all database access. */ public MysqlIdentityValueLoader(DatabaseContext dbCtx) { this.dbCtx = dbCtx; statementContainer = new ReleasableStatementContainer(); }
/** * Updates the database type. * * @param property * The database type property. */ public void setDbType(String property) { this.dbType = DatabaseType.fromString(property); }
/** * {@inheritDoc} */ @Override public void close() { statementContainer.close(); } }
/** * Creates a new instance. * * @param dbCtx * The database context to use for accessing the database. */ protected BaseDao(DatabaseContext dbCtx) { this.dbCtx = dbCtx; statementContainer = new ReleasableStatementContainer(); }
/** * {@inheritDoc} */ @Override public void close() { statementContainer.close(); } }
/** * {@inheritDoc} */ @Override public void close() { statementContainer.close(); } }
/** * {@inheritDoc} */ @Override public void close() { statementContainer.close(); } }