本文整理汇总了Java中net.sf.jsqlparser.expression.Alias类的典型用法代码示例。如果您正苦于以下问题:Java Alias类的具体用法?Java Alias怎么用?Java Alias使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Alias类属于net.sf.jsqlparser.expression包,在下文中一共展示了Alias类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: visit
import net.sf.jsqlparser.expression.Alias; //导入依赖的package包/类
@Override
public void visit(SelectExpressionItem selectExpressionItem) {
if (firstRun) {
if (selectExpressionItem.getAlias() != null) {
aliases.add(selectExpressionItem.getAlias().getName().toUpperCase());
}
} else {
if (selectExpressionItem.getAlias() == null) {
while (true) {
String alias = getNextAlias().toUpperCase();
if (!aliases.contains(alias)) {
aliases.add(alias);
selectExpressionItem.setAlias(new Alias(alias));
break;
}
}
}
}
}
开发者ID:WeiMei-Tian,项目名称:editor-sql,代码行数:21,代码来源:AddAliasesVisitor.java
示例2: visit
import net.sf.jsqlparser.expression.Alias; //导入依赖的package包/类
@Override
public void visit(PlainSelect plainSelect) {
for (SelectItem item : plainSelect.getSelectItems()) {
item.accept(this);
}
if (itemsExpr.size() > 1) {
BinaryExpression binExpr = createBinaryExpression();
binExpr.setLeftExpression(itemsExpr.get(0).getExpression());
for (int i = 1; i < itemsExpr.size() - 1; i++) {
binExpr.setRightExpression(itemsExpr.get(i).getExpression());
BinaryExpression binExpr2 = createBinaryExpression();
binExpr2.setLeftExpression(binExpr);
binExpr = binExpr2;
}
binExpr.setRightExpression(itemsExpr.get(itemsExpr.size() - 1).getExpression());
SelectExpressionItem sei = new SelectExpressionItem();
sei.setExpression(binExpr);
plainSelect.getSelectItems().clear();
plainSelect.getSelectItems().add(sei);
}
((SelectExpressionItem) plainSelect.getSelectItems().get(0)).setAlias(new Alias(alias));
}
开发者ID:WeiMei-Tian,项目名称:editor-sql,代码行数:27,代码来源:ConnectExpressionsVisitor.java
示例3: visit
import net.sf.jsqlparser.expression.Alias; //导入依赖的package包/类
@Override
public void visit(SubSelect subSelect) {
buffer.append("(");
if (subSelect.getWithItemsList() != null && !subSelect.getWithItemsList().isEmpty()) {
buffer.append("WITH ");
for (Iterator<WithItem> iter = subSelect.getWithItemsList().iterator(); iter.hasNext();) {
WithItem withItem = iter.next();
withItem.accept(this);
if (iter.hasNext()) {
buffer.append(",");
}
buffer.append(" ");
}
}
subSelect.getSelectBody().accept(this);
buffer.append(")");
Pivot pivot = subSelect.getPivot();
if (pivot != null) {
pivot.accept(this);
}
Alias alias = subSelect.getAlias();
if (alias != null) {
buffer.append(alias.toString());
}
}
开发者ID:WeiMei-Tian,项目名称:editor-sql,代码行数:26,代码来源:SelectDeParser.java
示例4: wrapSetOperationList
import net.sf.jsqlparser.expression.Alias; //导入依赖的package包/类
/**
* 包装SetOperationList
*
* @param setOperationList
* @return
*/
private SelectBody wrapSetOperationList(SetOperationList setOperationList) {
//获取最后一个plainSelect
PlainSelect plainSelect = setOperationList.getPlainSelects().get(setOperationList.getPlainSelects().size() - 1);
PlainSelect selectBody = new PlainSelect();
List<SelectItem> selectItems = getSelectItems(plainSelect);
selectBody.setSelectItems(selectItems);
//设置fromIterm
SubSelect fromItem = new SubSelect();
fromItem.setSelectBody(setOperationList);
fromItem.setAlias(new Alias(WRAP_TABLE));
selectBody.setFromItem(fromItem);
//order by
if (isNotEmptyList(plainSelect.getOrderByElements())) {
selectBody.setOrderByElements(plainSelect.getOrderByElements());
plainSelect.setOrderByElements(null);
}
return selectBody;
}
开发者ID:geeker-lait,项目名称:tasfe-framework,代码行数:27,代码来源:SqlServer.java
示例5: visit
import net.sf.jsqlparser.expression.Alias; //导入依赖的package包/类
@Override
public void visit(Table tableName) {
if (tableName == null) {
return;
}
String name = tableName.getName();
if (name != null) {
tableName.setName(CompatibilityUtils.fixMySqlName(name.toLowerCase()));
}
Alias alias = tableName.getAlias();
if (alias != null) {
String aliasName = alias.getName();
if (aliasName != null) {
alias.setName(CompatibilityUtils.fixMySqlName(aliasName.toLowerCase()));
}
}
}
开发者ID:diennea,项目名称:herddb,代码行数:18,代码来源:JdbcQueryRewriter.java
示例6: getEntityAlias
import net.sf.jsqlparser.expression.Alias; //导入依赖的package包/类
protected static Alias getEntityAlias(String entityName, PlainSelect query) {
FromItem fromItem = query.getFromItem();
if (hasEntityAlias(entityName, fromItem)) {
return fromItem.getAlias();
}
if(query.getJoins() != null) {
for(Object o : query.getJoins()) {
Join join = (Join) o;
if (hasEntityAlias(entityName, join.getRightItem())) {
return join.getRightItem().getAlias();
}
}
}
logger.debug("Alias from entity " + entityName + " not found in query " + query);
return null;
}
开发者ID:ManyDesigns,项目名称:Portofino,代码行数:17,代码来源:QueryUtils.java
示例7: wrapSetOperationList
import net.sf.jsqlparser.expression.Alias; //导入依赖的package包/类
/**
* 包装SetOperationList
*
* @param setOperationList
* @return
*/
private static SelectBody wrapSetOperationList(SetOperationList setOperationList) {
// 获取最后一个plainSelect
PlainSelect plainSelect = (PlainSelect)
setOperationList.getSelects().get(setOperationList.getSelects().size() - 1);
PlainSelect selectBody = new PlainSelect();
List<SelectItem> selectItems = getSelectItems(plainSelect);
selectBody.setSelectItems(selectItems);
//设置fromIterm
SubSelect fromItem = new SubSelect();
fromItem.setSelectBody(setOperationList);
fromItem.setAlias(new Alias(WRAP_TABLE));
selectBody.setFromItem(fromItem);
//order by
if (isNotEmptyList(plainSelect.getOrderByElements())) {
selectBody.setOrderByElements(plainSelect.getOrderByElements());
plainSelect.setOrderByElements(null);
}
return selectBody;
}
开发者ID:xushaomin,项目名称:apple-orm,代码行数:28,代码来源:SqlServer.java
示例8: wrapSetOperationList
import net.sf.jsqlparser.expression.Alias; //导入依赖的package包/类
/**
* 包装SetOperationList
*
* @param setOperationList
* @return
*/
protected SelectBody wrapSetOperationList(SetOperationList setOperationList) {
//获取最后一个plainSelect
SelectBody setSelectBody = setOperationList.getSelects().get(setOperationList.getSelects().size() - 1);
if (!(setSelectBody instanceof PlainSelect)) {
throw new RuntimeException("目前无法处理该SQL,您可以将该SQL发送给[email protected]协助作者解决!");
}
PlainSelect plainSelect = (PlainSelect) setSelectBody;
PlainSelect selectBody = new PlainSelect();
List<SelectItem> selectItems = getSelectItems(plainSelect);
selectBody.setSelectItems(selectItems);
//设置fromIterm
SubSelect fromItem = new SubSelect();
fromItem.setSelectBody(setOperationList);
fromItem.setAlias(new Alias(WRAP_TABLE));
selectBody.setFromItem(fromItem);
//order by
if (isNotEmptyList(plainSelect.getOrderByElements())) {
selectBody.setOrderByElements(plainSelect.getOrderByElements());
plainSelect.setOrderByElements(null);
}
return selectBody;
}
开发者ID:xushaomin,项目名称:apple-orm,代码行数:30,代码来源:SqlServer.java
示例9: wrapSetOperationList
import net.sf.jsqlparser.expression.Alias; //导入依赖的package包/类
/**
* 包装SetOperationList
*
* @param setOperationList
* @return
*/
protected SelectBody wrapSetOperationList(SetOperationList setOperationList) {
//获取最后一个plainSelect
SelectBody setSelectBody = setOperationList.getSelects().get(setOperationList.getSelects().size() - 1);
if (!(setSelectBody instanceof PlainSelect)) {
throw new PageException("目前无法处理该SQL,您可以将该SQL发送给[email protected]协助作者解决!");
}
PlainSelect plainSelect = (PlainSelect) setSelectBody;
PlainSelect selectBody = new PlainSelect();
List<SelectItem> selectItems = getSelectItems(plainSelect);
selectBody.setSelectItems(selectItems);
//设置fromIterm
SubSelect fromItem = new SubSelect();
fromItem.setSelectBody(setOperationList);
fromItem.setAlias(new Alias(WRAP_TABLE));
selectBody.setFromItem(fromItem);
//order by
if (isNotEmptyList(plainSelect.getOrderByElements())) {
selectBody.setOrderByElements(plainSelect.getOrderByElements());
plainSelect.setOrderByElements(null);
}
return selectBody;
}
开发者ID:pagehelper,项目名称:Mybatis-PageHelper,代码行数:30,代码来源:SqlServerParser.java
示例10: handleAlias
import net.sf.jsqlparser.expression.Alias; //导入依赖的package包/类
private static void handleAlias(Map<String, String> aliases, SubSelect subSelect) {
Alias alias = subSelect.getAlias();
if (alias != null) {
String aliasName = alias.getName();
if (aliasName != null) {
/*
FIXME: need to generalize,
ie for when there can be several un-named sub-selects referring
to columns with same names
*/
String tableName = UNNAMED_TABLE;
aliases.put(aliasName.trim().toLowerCase(), tableName.trim().toLowerCase());
}
}
}
开发者ID:EMResearch,项目名称:EvoMaster,代码行数:16,代码来源:SelectHeuristics.java
示例11: visit
import net.sf.jsqlparser.expression.Alias; //导入依赖的package包/类
@Override
public void visit(SelectExpressionItem selectExpressionItem)
{
selectExpressionItem.getExpression().accept(this);
ISqlExpression expression = getExpression();
SqlSelectItem selectItem = new SqlSelectItem(expression);
Alias alias = selectExpressionItem.getAlias();
if (alias != null) {
String aliasName = removeQuotesIfAny(alias.getName());
selectItem.setAliasName(aliasName);
}
mSelectItems.add(selectItem);
}
开发者ID:obidea,项目名称:semantika,代码行数:14,代码来源:SelectItemHandler.java
示例12: getAliasName
import net.sf.jsqlparser.expression.Alias; //导入依赖的package包/类
private String getAliasName(SelectExpressionItem selectExpressionItem)
{
Alias alias = selectExpressionItem.getAlias();
if (alias != null) {
return removeQuotesIfAny(alias.getName());
}
return ""; //$NON-NLS-1$ // empty alias name
}
开发者ID:obidea,项目名称:semantika,代码行数:9,代码来源:UserQueryHandler.java
示例13: Alias
import net.sf.jsqlparser.expression.Alias; //导入依赖的package包/类
final public Alias Alias() throws ParseException {
/* @bgen(jjtree) Alias */
SimpleNode jjtn000 = new SimpleNode(JJTALIAS);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
String name = null;
boolean useAs = false;
try {
switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
case K_AS:
jj_consume_token(K_AS);
useAs = true;
break;
default:
jj_la1[97] = jj_gen;
;
}
name = RelObjectName();
jjtree.closeNodeScope(jjtn000, true);
jjtc000 = false;
{
if (true)
return new Alias(name, useAs);
}
} catch (Throwable jjte000) {
if (jjtc000) {
jjtree.clearNodeScope(jjtn000);
jjtc000 = false;
} else {
jjtree.popNode();
}
if (jjte000 instanceof RuntimeException) {
{
if (true)
throw (RuntimeException) jjte000;
}
}
if (jjte000 instanceof ParseException) {
{
if (true)
throw (ParseException) jjte000;
}
}
{
if (true)
throw (Error) jjte000;
}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
}
}
throw new Error("Missing return statement in function");
}
开发者ID:WeiMei-Tian,项目名称:editor-sql,代码行数:55,代码来源:CCJSqlParser.java
示例14: getAlias
import net.sf.jsqlparser.expression.Alias; //导入依赖的package包/类
public Alias getAlias() {
return alias;
}
开发者ID:WeiMei-Tian,项目名称:editor-sql,代码行数:4,代码来源:SelectExpressionItem.java
示例15: setAlias
import net.sf.jsqlparser.expression.Alias; //导入依赖的package包/类
public void setAlias(Alias alias) {
this.alias = alias;
}
开发者ID:WeiMei-Tian,项目名称:editor-sql,代码行数:4,代码来源:SelectExpressionItem.java
示例16: getAlias
import net.sf.jsqlparser.expression.Alias; //导入依赖的package包/类
@Override
public Alias getAlias() {
return alias;
}
开发者ID:WeiMei-Tian,项目名称:editor-sql,代码行数:5,代码来源:SubJoin.java
示例17: setAlias
import net.sf.jsqlparser.expression.Alias; //导入依赖的package包/类
@Override
public void setAlias(Alias alias) {
this.alias = alias;
}
开发者ID:WeiMei-Tian,项目名称:editor-sql,代码行数:5,代码来源:SubJoin.java
示例18: getAlias
import net.sf.jsqlparser.expression.Alias; //导入依赖的package包/类
@Override
public Alias getAlias() {
return alias;
}
开发者ID:WeiMei-Tian,项目名称:editor-sql,代码行数:5,代码来源:SubSelect.java
示例19: setAlias
import net.sf.jsqlparser.expression.Alias; //导入依赖的package包/类
@Override
public void setAlias(Alias alias) {
this.alias = alias;
}
开发者ID:WeiMei-Tian,项目名称:editor-sql,代码行数:5,代码来源:SubSelect.java
示例20: getAlias
import net.sf.jsqlparser.expression.Alias; //导入依赖的package包/类
public Alias getAlias() {
return alias;
}
开发者ID:WeiMei-Tian,项目名称:editor-sql,代码行数:4,代码来源:ExpressionListItem.java
注:本文中的net.sf.jsqlparser.expression.Alias类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论