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


Java TimestampValue类代码示例

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


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

示例1: isConstant

import net.sf.jsqlparser.expression.TimestampValue; //导入依赖的package包/类
static boolean isConstant(Expression exp) {
    return exp instanceof StringValue
        || exp instanceof LongValue
        || exp instanceof NullValue
        || exp instanceof TimestampValue
        || exp instanceof JdbcParameter;
}
 
开发者ID:diennea,项目名称:herddb,代码行数:8,代码来源:SQLRecordPredicate.java

示例2: resolveValue

import net.sf.jsqlparser.expression.TimestampValue; //导入依赖的package包/类
private static Object resolveValue(Expression expression, boolean allowColumn) throws StatementExecutionException {
    if (expression instanceof JdbcParameter) {
        throw new StatementExecutionException("jdbcparameter expression not usable in this query");
    } else if (allowColumn && expression instanceof net.sf.jsqlparser.schema.Column) {
        // this is only for supporting back ticks in DDL
        return ((net.sf.jsqlparser.schema.Column) expression).getColumnName();
    } else if (expression instanceof StringValue) {
        return ((StringValue) expression).getValue();
    } else if (expression instanceof LongValue) {
        return ((LongValue) expression).getValue();
    } else if (expression instanceof TimestampValue) {
        return ((TimestampValue) expression).getValue();
    } else if (expression instanceof SignedExpression) {
        SignedExpression se = (SignedExpression) expression;
        switch (se.getSign()) {
            case '+': {
                return resolveValue(se.getExpression(), allowColumn);
            }
            case '-': {
                Object value = resolveValue(se.getExpression(), allowColumn);
                if (value == null) {
                    return null;
                }
                if (value instanceof Integer) {
                    return -1L * ((Integer) value);
                } else if (value instanceof Long) {
                    return -1L * ((Long) value);
                } else {
                    throw new StatementExecutionException("unsupported value type " + expression.getClass() + " with sign " + se.getSign() + " on value " + value + " of type " + value.getClass());
                }
            }
            default:
                throw new StatementExecutionException("unsupported value type " + expression.getClass() + " with sign " + se.getSign());
        }

    } else {
        throw new StatementExecutionException("unsupported value type " + expression.getClass());
    }
}
 
开发者ID:diennea,项目名称:herddb,代码行数:40,代码来源:SQLPlanner.java

示例3: testTimestamp

import net.sf.jsqlparser.expression.TimestampValue; //导入依赖的package包/类
@Test
public void testTimestamp() throws JSQLParserException {
    String statement = "SELECT * FROM tab1 WHERE a > {ts '2004-04-30 04:05:34.56'}";
    PlainSelect plainSelect = (PlainSelect) ((Select) parserManager.parse(new StringReader(statement))).getSelectBody();
    assertEquals("2004-04-30 04:05:34.56", ((TimestampValue) ((GreaterThan) plainSelect.getWhere()).getRightExpression()).getValue().toString());
    assertEquals(statement, "" + plainSelect);
}
 
开发者ID:marat-gainullin,项目名称:platypus-js,代码行数:8,代码来源:SelectTest.java

示例4: visit

import net.sf.jsqlparser.expression.TimestampValue; //导入依赖的package包/类
@Override
public void visit(TimestampValue value)
{
	setValue(value.getValue());
}
 
开发者ID:olavloite,项目名称:spanner-jdbc,代码行数:6,代码来源:AbstractSpannerExpressionVisitorAdapter.java

示例5: visit

import net.sf.jsqlparser.expression.TimestampValue; //导入依赖的package包/类
@Override
public void visit(TimestampValue value)
{
	visitExpression(col, value);
}
 
开发者ID:olavloite,项目名称:spanner-jdbc,代码行数:6,代码来源:DMLWhereClauseVisitor.java

示例6: visit

import net.sf.jsqlparser.expression.TimestampValue; //导入依赖的package包/类
@Override
public void visit(TimestampValue timestampValue) {
    buffer.append("{ts '").append(timestampValue.getValue().toString()).append("'}");
}
 
开发者ID:WeiMei-Tian,项目名称:editor-sql,代码行数:5,代码来源:ExpressionDeParser.java

示例7: visit

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

示例8: visit

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

示例9: visit

import net.sf.jsqlparser.expression.TimestampValue; //导入依赖的package包/类
@Override
public void visit(TimestampValue timestampValue) {
    this.getBuffer().append("?");
    values.add(timestampValue.getValue());
}
 
开发者ID:RapturePlatform,项目名称:Rapture,代码行数:6,代码来源:PreparedExpressionConverter.java

示例10: visit

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

示例11: testTimestamp

import net.sf.jsqlparser.expression.TimestampValue; //导入依赖的package包/类
public void testTimestamp() throws JSQLParserException {
	String statement = "SELECT * FROM tab1 WHERE a > {ts '2004-04-30 04:05:34.56'}";
	PlainSelect plainSelect = (PlainSelect) ((Select) parserManager.parse(new StringReader(statement))).getSelectBody();
	assertEquals("2004-04-30 04:05:34.56", ((TimestampValue)((GreaterThan) plainSelect.getWhere()).getRightExpression()).getValue().toString());
	assertEquals(statement, ""+plainSelect);
}
 
开发者ID:UBOdin,项目名称:jsqlparser,代码行数:7,代码来源:SelectTest.java

示例12: visit

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

示例13: visit

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

示例14: visit

import net.sf.jsqlparser.expression.TimestampValue; //导入依赖的package包/类
public void visit(TimestampValue timestampValue) {
    buffer.append(timestampValue.getComment() != null ? timestampValue.getComment() + " " + ExpressionDeParser.LINE_SEPARATOR : "").append("{ts '").append(timestampValue.getValue().toString()).append("'}");
}
 
开发者ID:marat-gainullin,项目名称:platypus-js,代码行数:4,代码来源:ExpressionDeParser.java

示例15: visit

import net.sf.jsqlparser.expression.TimestampValue; //导入依赖的package包/类
@Override
public void visit(TimestampValue timestampValue)
{
   Timestamp value = timestampValue.getValue();
   mExpression = sSqlFactory.createDateTimeValueExpression(value);
}
 
开发者ID:obidea,项目名称:semantika,代码行数:7,代码来源:SelectItemHandler.java


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