当前位置: 首页>>代码示例>>Java>>正文


Java Parenthesis类代码示例

本文整理汇总了Java中net.sf.jsqlparser.expression.Parenthesis的典型用法代码示例。如果您正苦于以下问题:Java Parenthesis类的具体用法?Java Parenthesis怎么用?Java Parenthesis使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Parenthesis类属于net.sf.jsqlparser.expression包,在下文中一共展示了Parenthesis类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: visit

import net.sf.jsqlparser.expression.Parenthesis; //导入依赖的package包/类
@Override
public void visit(Parenthesis parenthesis) {
    if (parenthesis.isNot()) {
        buffer.append(NOT);
    }

    buffer.append("(");
    parenthesis.getExpression().accept(this);
    buffer.append(")");

}
 
开发者ID:WeiMei-Tian,项目名称:editor-sql,代码行数:12,代码来源:ExpressionDeParser.java

示例2: visit

import net.sf.jsqlparser.expression.Parenthesis; //导入依赖的package包/类
public void visit(Parenthesis parenthesis) {
    if (parenthesis.isNot()) {
        buffer.append(parenthesis.getCommentNot() != null ? " " + parenthesis.getCommentNot() + ExpressionDeParser.LINE_SEPARATOR : "").append(" not ");
    }
    buffer.append(parenthesis.getCommentBeginBracket() != null ? parenthesis.getCommentBeginBracket() + " " + ExpressionDeParser.LINE_SEPARATOR : "").append("(");
    parenthesis.getExpression().accept(this);
    buffer.append(parenthesis.getCommentEndBracket() != null ? parenthesis.getCommentEndBracket() + " " + ExpressionDeParser.LINE_SEPARATOR : "").append(")");

}
 
开发者ID:marat-gainullin,项目名称:platypus-js,代码行数:10,代码来源:ExpressionDeParser.java

示例3: getInstance

import net.sf.jsqlparser.expression.Parenthesis; //导入依赖的package包/类
public static Projector getInstance(Expression expression, String alias, QueryTypeExtractor queryTypeExtractor) {
	Projector instance = null;
	if (expression instanceof net.sf.jsqlparser.schema.Column) {
		instance = new ColumnProjector((net.sf.jsqlparser.schema.Column) expression, alias, queryTypeExtractor);
	} else if (expression instanceof Function) {
		instance = new FunctionProjector((Function) expression, alias, queryTypeExtractor);
	} else if (expression instanceof BinaryExpression) {
		instance = new BinaryExpressionProjector((BinaryExpression) expression, alias, queryTypeExtractor);
	} else if (expression instanceof LongValue) {
		instance = new LongProjector(expression, alias, queryTypeExtractor);
	} else if (expression instanceof StringValue) {
		instance = new StringProjector(expression, alias, queryTypeExtractor);
	} else if (expression instanceof DoubleValue) {
		instance = new DoubleProjector(expression, alias, queryTypeExtractor);
	} else if (expression instanceof Parenthesis) {
		instance = new ParenthesisProjector((Parenthesis) expression, queryTypeExtractor);
	} else if (expression instanceof JdbcParameter) {
		instance = new JdbcParameterProjector(queryTypeExtractor);
	} else if (expression instanceof SubSelect) {
		instance = new SubSelectProjector((SubSelect) expression, alias, queryTypeExtractor);
	} else {
		throw new RuntimeException("Not supported");
	}
	
	return instance;
}
 
开发者ID:sebastianoe,项目名称:s4j,代码行数:27,代码来源:Projector.java

示例4: visit

import net.sf.jsqlparser.expression.Parenthesis; //导入依赖的package包/类
@Override
public void visit(Parenthesis parenthesis) {
    parenthesis.getExpression().accept(this);
}
 
开发者ID:WeiMei-Tian,项目名称:editor-sql,代码行数:5,代码来源:TablesNamesFinder.java

示例5: visit

import net.sf.jsqlparser.expression.Parenthesis; //导入依赖的package包/类
@Override
public void visit(Parenthesis parenthesis) {
    // TODO Auto-generated method stub
    
}
 
开发者ID:devpage,项目名称:sharding-quickstart,代码行数:6,代码来源:TablesNamesFinder.java

示例6: visit

import net.sf.jsqlparser.expression.Parenthesis; //导入依赖的package包/类
@Override
public void visit(Parenthesis prnths) {
    prnths.getExpression().accept(this);
}
 
开发者ID:diennea,项目名称:herddb,代码行数:5,代码来源:ColumnReferencesDiscovery.java

示例7: visit

import net.sf.jsqlparser.expression.Parenthesis; //导入依赖的package包/类
@Override
public void visit(Parenthesis arg0) {
   log.debug("sql Parenthesis value expression = " + arg0.toString());
   value = arg0.toString();
}
 
开发者ID:Wolfgang-Winter,项目名称:cibet,代码行数:6,代码来源:SqlExpressionParser.java

示例8: visit

import net.sf.jsqlparser.expression.Parenthesis; //导入依赖的package包/类
public void visit(Parenthesis parenthesis) {
	parenthesis.getExpression().accept(this);
}
 
开发者ID:UBOdin,项目名称:jsqlparser,代码行数:4,代码来源:TablesNamesFinder.java

示例9: getObjectByPk

import net.sf.jsqlparser.expression.Parenthesis; //导入依赖的package包/类
/**
 * Loads an object by primary key. It also verifies that the object falls within the results of a given query.
 * @param persistence the persistence object
 * @param database the database (connection provider)
 * @param entityName the name of the entity to load
 * @param pk the primary key object
 * @param hqlQueryString the query (where condition) that the object must fulfill
 * @param rootObject the OGNL root object against which to evaluate the query string.
 * @return the loaded object, or null if an object with that key does not exist or falls outside the query.
 */
public static Object getObjectByPk(
        Persistence persistence, String database, String entityName,
        Serializable pk, String hqlQueryString, Object rootObject) {
    TableAccessor table = persistence.getTableAccessor(database, entityName);
    List<Object> result;
    PropertyAccessor[] keyProperties = table.getKeyProperties();
    OgnlHqlFormat hqlFormat = OgnlHqlFormat.create(hqlQueryString);
    String formatString = hqlFormat.getFormatString();
    Object[] ognlParameters = hqlFormat.evaluateOgnlExpressions(rootObject);
    int p = ognlParameters.length;
    Object[] parameters = new Object[p + keyProperties.length];
    System.arraycopy(ognlParameters, 0, parameters, 0, p);
    try {
        PlainSelect parsedQuery = parseQuery(new CCJSqlParserManager(), formatString);
        if(parsedQuery.getWhere() == null) {
            return getObjectByPk(persistence, database, entityName, pk);
        }

        Alias mainEntityAlias = getEntityAlias(entityName, parsedQuery);
        net.sf.jsqlparser.schema.Table mainEntityTable;
        if(mainEntityAlias != null) {
            mainEntityTable = new net.sf.jsqlparser.schema.Table(null, mainEntityAlias.getName());
        } else {
            mainEntityTable = new net.sf.jsqlparser.schema.Table();
        }


        for(int i = 0; i < keyProperties.length; i++) {
            PropertyAccessor propertyAccessor = keyProperties[i];
            EqualsTo condition = new EqualsTo();
            parsedQuery.setWhere(
                    new AndExpression(condition, new Parenthesis(parsedQuery.getWhere())));
            net.sf.jsqlparser.schema.Column column =
                    new net.sf.jsqlparser.schema.Column(mainEntityTable, propertyAccessor.getName());
            condition.setLeftExpression(column);
            JdbcParameter jdbcParameter = new JdbcParameter();
            jdbcParameter.setIndex(p + i + 1);
            condition.setRightExpression(jdbcParameter);
            parameters[p + i] = propertyAccessor.get(pk);
        }

        String fullQueryString = parsedQuery.toString();
        if(fullQueryString.toLowerCase().startsWith(FAKE_SELECT_PREFIX)) {
            fullQueryString = fullQueryString.substring(FAKE_SELECT_PREFIX.length());
        }
        Session session = persistence.getSession(database);
        result = runHqlQuery(session, fullQueryString, parameters);
        if(result != null && !result.isEmpty()) {
            return result.get(0);
        } else {
            return null;
        }
    } catch (JSQLParserException e) {
        throw new Error(e);
    }
}
 
开发者ID:ManyDesigns,项目名称:Portofino,代码行数:67,代码来源:QueryUtils.java

示例10: visit

import net.sf.jsqlparser.expression.Parenthesis; //导入依赖的package包/类
@Override
public void visit(Parenthesis arg0) {
	isSimple = false;
}
 
开发者ID:coastland,项目名称:gsp-dba-maven-plugin,代码行数:5,代码来源:ViewAnalyzer.java

示例11: visit

import net.sf.jsqlparser.expression.Parenthesis; //导入依赖的package包/类
public void visit(Parenthesis parenthesis) {
    parenthesis.getExpression().accept(this);
}
 
开发者ID:marat-gainullin,项目名称:platypus-js,代码行数:4,代码来源:TablesNamesFinder.java

示例12: ParenthesisProjector

import net.sf.jsqlparser.expression.Parenthesis; //导入依赖的package包/类
public ParenthesisProjector(Parenthesis parenthesis, QueryTypeExtractor projectionsExtractor) {
	super(null, projectionsExtractor);
	this.parenthesis = parenthesis;
}
 
开发者ID:sebastianoe,项目名称:s4j,代码行数:5,代码来源:ParenthesisProjector.java

示例13: visit

import net.sf.jsqlparser.expression.Parenthesis; //导入依赖的package包/类
@Override
public void visit(Parenthesis parenthesis)
{
   increaseOpenParenthesisCount();
   parenthesis.getExpression().accept(this);
}
 
开发者ID:obidea,项目名称:semantika,代码行数:7,代码来源:SelectItemHandler.java

示例14: visit

import net.sf.jsqlparser.expression.Parenthesis; //导入依赖的package包/类
@Override
public void visit(Parenthesis parenthesis)
{
   throw new IllegalOperationException("Illegal SQL ON expression: " + parenthesis); //$NON-NLS-1$
}
 
开发者ID:obidea,项目名称:semantika,代码行数:6,代码来源:JoinConditionHandler.java

示例15: getObjectByPk

import net.sf.jsqlparser.expression.Parenthesis; //导入依赖的package包/类
/**
 * Loads an object by primary key. It also verifies that the object falls within the results of a given query.
 * 
 * @param persistence the persistence object
 * @param database the database (connection provider)
 * @param entityName the name of the entity to load
 * @param pk the primary key object
 * @param hqlQueryString the query (where condition) that the object must fulfill
 * @param rootObject the OGNL root object against which to evaluate the query string.
 * @return the loaded object, or null if an object with that key does not exist or falls outside the query.
 */
public static Object getObjectByPk(Persistence persistence, String database, String entityName, Serializable pk,
		String hqlQueryString, Object rootObject) {
	TableAccessor table = persistence.getTableAccessor(database, entityName);
	List<Object> result;
	PropertyAccessor[] keyProperties = table.getKeyProperties();
	OgnlSqlFormat sqlFormat = OgnlSqlFormat.create(hqlQueryString);
	String formatString = sqlFormat.getFormatString();
	Object[] ognlParameters = sqlFormat.evaluateOgnlExpressions(rootObject);
	int i = keyProperties.length;
	int p = ognlParameters.length;
	Object[] parameters = new Object[p + i];
	System.arraycopy(ognlParameters, 0, parameters, i, p);
	try {
		PlainSelect parsedQuery = parseQuery(new CCJSqlParserManager(), formatString);
		if (parsedQuery.getWhere() == null) {
			return getObjectByPk(persistence, database, entityName, pk);
		}

		String mainEntityAlias = getEntityAlias(entityName, parsedQuery);
		net.sf.jsqlparser.schema.Table mainEntityTable;
		if (mainEntityAlias != null) {
			mainEntityTable = new net.sf.jsqlparser.schema.Table(null, mainEntityAlias);
		} else {
			mainEntityTable = new net.sf.jsqlparser.schema.Table();
		}

		for (PropertyAccessor propertyAccessor : keyProperties) {
			i--;
			EqualsTo condition = new EqualsTo();
			parsedQuery.setWhere(new AndExpression(condition, new Parenthesis(parsedQuery.getWhere())));
			net.sf.jsqlparser.schema.Column column = new net.sf.jsqlparser.schema.Column(mainEntityTable,
					propertyAccessor.getName());
			condition.setLeftExpression(column);
			condition.setRightExpression(new JdbcParameter());
			parameters[i] = propertyAccessor.get(pk);
		}

		String fullQueryString = parsedQuery.toString();
		if (fullQueryString.toLowerCase().startsWith(FAKE_SELECT_PREFIX)) {
			fullQueryString = fullQueryString.substring(FAKE_SELECT_PREFIX.length());
		}
		Session session = persistence.getSession(database);
		result = runHqlQuery(session, fullQueryString, parameters);
		if (result != null && !result.isEmpty()) {
			return result.get(0);
		} else {
			return null;
		}
	} catch (JSQLParserException e) {
		throw new Error(e);
	}
}
 
开发者ID:hongliangpan,项目名称:manydesigns.cn,代码行数:64,代码来源:QueryUtils.java


注:本文中的net.sf.jsqlparser.expression.Parenthesis类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。