}
private List<SmallEventOfDay> loadSmallDateContents(ResultSet result,
String attributeNameStart, String attributeNameEnd) throws SQLException {
List<SmallEventOfDay> smallEvents = new ArrayList<SmallEventOfDay>();
SmallEventOfDay smallEvent = null;
String prevId = null;
while (result.next()) {
String id = result.getString(1);
if (!id.equals(prevId)) {
if (smallEvent != null) {
smallEvents.add(smallEvent);
}
smallEvent = new SmallEventOfDay();
}
smallEvent.setId(id);
String attrName = result.getString(2);
if (attrName.equals(attributeNameStart)) {
Date dataInizio = this.dateFromSQL(result.getDate(4));
smallEvent.setStart(dataInizio);
} else if (attrName.equals(attributeNameEnd)) {
Date endDate = this.dateFromSQL(result.getDate(4));
smallEvent.setEnd(endDate);
}
prevId = id;
}
if (smallEvent != null) {
smallEvents.add(smallEvent);