private Object getDependableId(Object id, String column) {
		String query = "SELECT " + column + " FROM " + getTableName() + " WHERE ID = ?";
		if (isHistorized()) {
			query += " AND VERSION = 0";
		}
		try (PreparedStatement preparedStatement = createStatement(sqlRepository.getConnection(), query, false)) {
			preparedStatement.setObject(1, id);
			try (ResultSet resultSet = preparedStatement.executeQuery()) {
				if (resultSet.next()) {
					return resultSet.getObject(1);
				} else {
					return null;
				}
			}
		} catch (SQLException x) {
			throw new RuntimeException(x.getMessage());
		}
	}
private Object getDependableId ( Object id , String column ) { String query = "SELECT " + column + " FROM " + getTableName ( ) + " WHERE ID = ?" ; if ( isHistorized ( ) ) { query += " AND VERSION = 0" ; } try ( PreparedStatement preparedStatement = createStatement ( sqlRepository . getConnection ( ) , query , false ) ) { preparedStatement . setObject ( 1 , id ) ; try ( ResultSet resultSet = preparedStatement . executeQuery ( ) ) { if ( resultSet . next ( ) ) { return resultSet . getObject ( 1 ) ; } else { return null ; } } } catch ( SQLException x ) { throw new RuntimeException ( x . getMessage ( ) ) ; } }
TODO multiple dependables could be get with one (prepared) statement