Skip to content

Commit

Permalink
#3061 Fixed missing column typeId for event handlers
Browse files Browse the repository at this point in the history
fix/#3061_Fixed_missing_column_typeId_for_event_handlers
  • Loading branch information
Patrykb0802 committed Dec 7, 2024
1 parent 284961e commit 82fa866
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions src/org/scada_lts/dao/event/EventDAO.java
Original file line number Diff line number Diff line change
Expand Up @@ -796,10 +796,23 @@ public Integer mapRow(ResultSet rs, int rowNum) throws SQLException {
}

private static EventType createEventType(ResultSet rs) throws SQLException {
int typeId = rs.getInt(COLUMN_NAME_TYPE_ID);
int typeRef1 = rs.getInt(COLUMN_NAME_TYPE_REF_1);
int typeRef2 = rs.getInt(COLUMN_NAME_TYPE_REF_2);
int typeRef3 = rs.getInt(COLUMN_NAME_TYPE_REF_3);
int typeId;
int typeRef1;
int typeRef2;
int typeRef3;

try {
typeId = rs.getInt(COLUMN_NAME_TYPE_ID);
typeRef1 = rs.getInt(COLUMN_NAME_TYPE_REF_1);
typeRef2 = rs.getInt(COLUMN_NAME_TYPE_REF_2);
typeRef3 = rs.getInt(COLUMN_NAME_TYPE_REF_3);
} catch (SQLException e) {
typeId = rs.getInt(COLUMN_NAME_EVENT_HANDLER_TYPE_ID);
typeRef1 = rs.getInt(COLUMN_NAME_EVENT_HANDLER_TYPE_REF1);
typeRef2 = rs.getInt(COLUMN_NAME_EVENT_HANDLER_TYPE_REF2);
typeRef3 = rs.getInt(COLUMN_NAME_EVENT_HANDLER_TYPE_REF2);
}

return EventTypeUtil.createEventType(typeId, typeRef1, typeRef2, typeRef3);
}

Expand Down

0 comments on commit 82fa866

Please sign in to comment.