本文整理汇总了Java中net.sf.jsqlparser.statement.select.PlainSelect.setFromItem方法的典型用法代码示例。如果您正苦于以下问题:Java PlainSelect.setFromItem方法的具体用法?Java PlainSelect.setFromItem怎么用?Java PlainSelect.setFromItem使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.sf.jsqlparser.statement.select.PlainSelect
的用法示例。
在下文中一共展示了PlainSelect.setFromItem方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buildSelectFromTableAndSelectItems
import net.sf.jsqlparser.statement.select.PlainSelect; //导入方法依赖的package包/类
public static Select buildSelectFromTableAndSelectItems(Table table, SelectItem ... selectItems) {
Select select = new Select();
PlainSelect body = new PlainSelect();
body.addSelectItems(selectItems);
body.setFromItem(table);
select.setSelectBody(body);
return select;
}
示例2: ItemList
import net.sf.jsqlparser.statement.select.PlainSelect; //导入方法依赖的package包/类
final public ItemsList ItemList() throws ParseException {
ItemsList itemsList = null;
Table table = null;
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case 80:
jj_consume_token(80);
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case K_KEY:
case K_NOT:
case K_END:
case K_NULL:
case K_CASE:
case K_BEGIN:
case K_SELECT:
case K_EXISTS:
case K_REPLACE:
case K_CAST:
case S_DOUBLE:
case S_INTEGER:
case S_IDENTIFIER:
case S_CHAR_LITERAL:
case S_QUOTED_IDENTIFIER:
case 80:
case 84:
case 96:
case 97:
case 100:
case 102:
case 103:
case 104:
if (jj_2_19(2147483647)) {
itemsList = SubSelect();
} else if (jj_2_20(2147483647)) {
itemsList = ExpressionList();
} else {
jj_consume_token(-1);
throw new ParseException();
}
break;
default:
jj_la1[85] = jj_gen;
;
}
jj_consume_token(81);
break;
default:
jj_la1[86] = jj_gen;
if (jj_2_21(2147483647)) {
table = Table();
// Encode `x IN tableName` as `x in (SELECT * FROM tableName)`
SubSelect subSel = new SubSelect();
PlainSelect body = new PlainSelect();
subSel.setAlias(table.getName());
subSel.setSelectBody(body);
body.setFromItem(table);
body.setSelectItems(Arrays.asList(
new AllColumns()
));
itemsList = subSel;
} else {
jj_consume_token(-1);
throw new ParseException();
}
}
{if (true) return itemsList;}
throw new Error("Missing return statement in function");
}