コード例 #1
0
 @Override
 public Collection<IPZoneEntity> listIPZones() {
   return listEntities(
       IPZONE_QUERY_ALL_STATEMENT,
       rs -> {
         try {
           IPZoneEntity entity = new IPZoneEntity();
           entity.setIphost(rs.getString(1));
           entity.setSecurityZone(rs.getString(2));
           return entity;
         } catch (Exception ex) {
           throw new IllegalStateException(ex);
         }
       });
 }
コード例 #2
0
 @Override
 public OpResult addIPZone(Collection<IPZoneEntity> h) {
   return addEntities(
       IPZONE_INSERT_STATEMENT,
       h,
       (entity, statement) -> {
         IPZoneEntity e = (IPZoneEntity) entity;
         try {
           statement.setString(1, e.getIphost());
           statement.setString(2, e.getSecurityZone());
         } catch (Exception ex) {
           throw new IllegalStateException(ex);
         }
         return statement;
       });
 }