while (rs.next()) {
int id = rs.getInt(1);
int start = rs.getInt(2);
int end = rs.getInt(3);
if (entry == null) {
entry = new RDBMSDatabaseEntry(new NodeIdentifier(id), new TimeSequence(start, end));
add(entry);
} else {
if (entry.identifier().nodeID() == id) {
entry.timestamp().elongate(start, end);
} else {
entry = new RDBMSDatabaseEntry(new NodeIdentifier(id), new TimeSequence(start, end));
add(entry);
}
}
}
rs.close();
pStmtSelectLabel.setInt(1, database.getDisplaySchemaNode().id());
rs = pStmtSelectLabel.executeQuery();
entry = null;
int maxTime = Integer.MIN_VALUE;
while (rs.next()) {
int id = rs.getInt(1);
String value = rs.getString(2);
int end = DatabaseConstants.RelTimestampColEndValOpen;
rs.getInt(3);
if (!rs.wasNull()) {
end = rs.getInt(4);
}
if (entry == null) {
entry = get(new NodeIdentifier(id));
maxTime = Integer.MIN_VALUE;
} else if (entry.identifier().nodeID() != id) {
entry = get(new NodeIdentifier(id));
maxTime = Integer.MIN_VALUE;
}
if (end == DatabaseConstants.RelTimestampColEndValOpen) {
entry.label(value);
maxTime = Integer.MAX_VALUE;
} else if (end > maxTime) {
entry.label(value);
maxTime = end;
}
}
rs.close();
rs = pStmtSelectLastChange.executeQuery();
while (rs.next()) {
get(new NodeIdentifier(rs.getInt(1))).lastChange(rs.getInt(2));
}
rs.close();
pStmtSelectContent.close();
pStmtSelectLabel.close();
pStmtSelectLastChange.close();