use of org.apache.nifi.registry.db.entity.BucketItemEntityType in project nifi-registry by apache.
the class BucketItemEntityRowMapper method mapRow.
@Nullable
@Override
public BucketItemEntity mapRow(ResultSet rs, int rowNum) throws SQLException {
final BucketItemEntityType type = BucketItemEntityType.valueOf(rs.getString("ITEM_TYPE"));
// Create the appropriate type of sub-class, eventually populate specific data for each type
final BucketItemEntity item;
switch(type) {
case FLOW:
item = new FlowEntity();
break;
default:
// should never happen
item = new BucketItemEntity();
break;
}
// populate fields common to all bucket items
item.setId(rs.getString("ID"));
item.setName(rs.getString("NAME"));
item.setDescription(rs.getString("DESCRIPTION"));
item.setCreated(rs.getTimestamp("CREATED"));
item.setModified(rs.getTimestamp("MODIFIED"));
item.setBucketId(rs.getString("BUCKET_ID"));
item.setBucketName(rs.getString("BUCKET_NAME"));
item.setType(type);
return item;
}
Aggregations