attr = (StateAttribute) grandChild.getState();
} else {
attr = (StateAttribute) root.getChild(ChildSide.LEFT).getState();
}
DboColumnMeta info = attr.getColumnInfo();
ViewInfoImpl viewInfo = attr.getViewInfo();
ScanInfo scanInfo = createScanInfo(viewInfo, info);
alreadyJoinedViews.add(viewInfo);
if(info.isIndexed()) {
//its an indexed column
return processIndexColumn(root, scanInfo, viewInfo, info);
} else if (info.getOwner().getIdColumnMeta().getColumnName().equals(info.getColumnName())) {
//its a non-indexed primary key
return processPrimaryKey(root, scanInfo, viewInfo, info);
} else
throw new IllegalArgumentException("You cannot have '"+info.getColumnName() + "' in your sql query since "+info.getColumnName()+" is neither a Primary Key nor a column with @Index annotation on the field in the entity");
}