org.hibernate.query.Query.setTimestamp()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(3.0k)|赞(0)|评价(0)|浏览(146)

本文整理了Java中org.hibernate.query.Query.setTimestamp方法的一些代码示例,展示了Query.setTimestamp的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.setTimestamp方法的具体详情如下:
包路径:org.hibernate.query.Query
类名称:Query
方法名:setTimestamp

Query.setTimestamp介绍

[英]Bind a positional Date-valued parameter using the full Timestamp.
[中]使用完整时间戳绑定位置日期值参数。

代码示例

代码示例来源:origin: hibernate/hibernate-orm

final Query queryWithTimestamp = s.createQuery( "from TimestampPropertyTest$Entity where ts=?1" ).setTimestamp( 1, eOrig.ts );
final Entity eQueriedWithTimestamp = (Entity) queryWithTimestamp.uniqueResult();
assertNotNull( eQueriedWithTimestamp );

代码示例来源:origin: hibernate/hibernate-orm

final Query queryWithTimestamp = s.createQuery( "from Entity where ts= ?1" ).setTimestamp( 1, eOrig.ts );
final Entity eQueriedWithTimestamp = (Entity) queryWithTimestamp.uniqueResult();
assertNotNull( eQueriedWithTimestamp );

代码示例来源:origin: hibernate/hibernate-orm

final Query queryWithTimestamp =
    s.createQuery( "from Entity where tsColumnDefault= ?1" )
        .setTimestamp( 1, eOrig.tsColumnDefault );
final Entity eQueriedWithTimestamp = (Entity) queryWithTimestamp.uniqueResult();
assertNotNull( eQueriedWithTimestamp );

代码示例来源:origin: hibernate/hibernate-orm

final Query queryWithTimestamp =
    s.createQuery( "from TimestampPropertyTest$Entity where tsColumnDefault=?1" )
        .setTimestamp( 1, eOrig.tsColumnDefault );
final Entity eQueriedWithTimestamp = (Entity) queryWithTimestamp.uniqueResult();
assertNotNull( eQueriedWithTimestamp );

代码示例来源:origin: hibernate/hibernate-orm

final Query queryWithTimestamp =
    s.createQuery( "from Entity where tsColumnDefinition= ?1" )
        .setTimestamp( 1, eOrig.tsColumnDefinition );
final Entity eQueriedWithTimestamp = (Entity) queryWithTimestamp.uniqueResult();
assertNotNull( eQueriedWithTimestamp );

代码示例来源:origin: com.atlassian.hibernate/hibernate.adapter

@Override
@SuppressWarnings("deprecation")
public Query setTimestamp(final String name, final Date date) {
  if (queryV2ForCompare != null) {
    queryV2ForCompare.setTimestamp(name, date);
  }
  query.setTimestamp(name, date);
  return this;
}

代码示例来源:origin: com.atlassian.hibernate/hibernate.adapter

@Override
@SuppressWarnings("deprecation")
public Query setTimestamp(final int position, final Date date) {
  if (queryV2ForCompare != null) {
    queryV2ForCompare.setTimestamp(position, date);
  }
  query.setTimestamp(adjustParameterPosition(position), date);
  return this;
}

代码示例来源:origin: jpos/jPOS-EE

@SuppressWarnings("unchecked")
public List<Thing> listByTimestampValue (String type, Date value) {
  Query query = db.session().getNamedQuery ("list-by-timestamp-value")
    .setString ("type", type)
    .setTimestamp ("value", value);
  return (List<Thing>) query.list();
}
@SuppressWarnings("unchecked")

代码示例来源:origin: jpos/jPOS-EE

@SuppressWarnings("unchecked")
public List<Thing> listByTimestampNameValue (String type, String name, Date value) {
  Query query = db.session().getNamedQuery ("list-by-timestamp-name-value")
    .setString ("type", type)
    .setString ("name", name)
    .setTimestamp ("value", value);
  return (List<Thing>) query.list();
}

相关文章