result set

This commit is contained in:
jackdaw@loafle.com 2017-04-26 12:12:25 +09:00
parent a647c230e1
commit b5f768dc89
2 changed files with 5 additions and 1 deletions

View File

@ -1,6 +1,7 @@
package com.loafle.overflow.crawler.result;
import com.loafle.overflow.crawler.config.Item;
import com.loafle.overflow.crawler.config.MappingInfo;
import java.util.ArrayList;
import java.util.HashMap;
@ -42,6 +43,9 @@ public abstract class OFResultSet {
// methods
static public OFResultSet newInstance(Item item) {
if (item.getMappingInfo() == null) {
item.setMappingInfo(new MappingInfo());
}
String type = (String) item.getMappingInfo().getParseDirection();
if (type != null && type.equals("row")) {
return new OFResultSetRow(item);

View File

@ -77,7 +77,7 @@ public class OFResultSetRow extends OFResultSet{
for (String keyColumn: keyColumns) {
String row = data.get(this.meta.get(keyColumn));
for (int i =0 ; i < keys.size() ; ++i) {
if (row.equals(keys.get(i))) {
if (row.equals(keys.get(i).getKey())) {
findIndex = i;
find = true;
break;