Beispiel #1
0
        @Override
        public OutputField mapRow(ResultSet rs, int rowNum) throws SQLException {
          OutputField field = new OutputField();

          field.setId(rs.getLong("ID"));
          field.setName(rs.getString("NAME"));
          field.setOrderInFile(rs.getInt("ORDER_IN_FILE"));
          field.setVersion(rs.getInt("VERSION"));

          OutputFile file = new OutputFile();
          file.setId(rs.getLong("FILE_ID"));
          field.setFile(file);

          Long ruleId = rs.getLong("RULE_ID");
          if (ruleId > 0) {
            ValidationRule rule = new ValidationRule();
            rule.setId(ruleId);
            field.setRule(rule);
          }

          return field;
        }
Beispiel #2
0
        @Override
        public OutputFile mapRow(ResultSet rs, int rowNum) throws SQLException {
          OutputFile file = new OutputFile();

          file.setId(rs.getLong("ID"));
          file.setName(rs.getString("NAME"));
          file.setOrderInConfig(rs.getInt("ORDER_IN_CONFIG"));
          file.setVersion(rs.getInt("VERSION"));

          ConstraintConfig config = new ConstraintConfig();
          config.setId(rs.getLong("CONFIG_ID"));
          file.setConfig(config);

          Long parentId = rs.getLong("PARENT_ID");
          if (parentId > 0) {
            OutputFile parent = new OutputFile();
            parent.setId(parentId);
            file.setParent(parent);
          }

          return file;
        }