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

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

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

Query.setTime介绍

[英]Bind a positional Date-valued parameter using just the Time portion.
[中]仅使用时间部分绑定位置日期值参数。

代码示例

代码示例来源:origin: com.github.cafdataprocessing/corepolicy-hibernate

@Override
public Query setTime(String s, Date date) {
  return query.setTime(s, date);
}

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

public Query setParameter(String name, Date value, TemporalType temporalType) {
  try {
    if ( temporalType == DATE ) {
      query.setDate( name, value );
    }
    else if ( temporalType == TIME ) {
      query.setTime( name, value );
    }
    else if ( temporalType == TIMESTAMP ) {
      query.setTimestamp( name, value );
    }
    return this;
  }
  catch (QueryParameterException e) {
    throw new IllegalArgumentException( e );
  }
  catch (HibernateException he) {
    em.throwPersistenceException( he );
    return null;
  }
}

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

public Query setParameter(int position, Date value, TemporalType temporalType) {
  try {
    if ( isPositionalParameter() ) {
      String name = Integer.toString( position );
      this.setParameter( name, value, temporalType );
    }
    else {
      if ( temporalType == DATE ) {
        query.setDate( position - 1, value );
      }
      else if ( temporalType == TIME ) {
        query.setTime( position - 1, value );
      }
      else if ( temporalType == TIMESTAMP ) {
        query.setTimestamp( position - 1, value );
      }
    }
    return this;
  }
  catch (QueryParameterException e) {
    throw new IllegalArgumentException( e );
  }
  catch (HibernateException he) {
    em.throwPersistenceException( he );
    return null;
  }
}

代码示例来源:origin: com.github.cafdataprocessing/corepolicy-hibernate

@Override
public Query setTime(int i, Date date) {
  return query.setTime(i, date);
}

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate.ejb

/**
 * {@inheritDoc}
 */
public TypedQuery<X> setParameter(String name, Date value, TemporalType temporalType) {
  try {
    if ( temporalType == DATE ) {
      query.setDate( name, value );
    }
    else if ( temporalType == TIME ) {
      query.setTime( name, value );
    }
    else if ( temporalType == TIMESTAMP ) {
      query.setTimestamp( name, value );
    }
    registerParameterBinding( getParameter( name ), value );
    return this;
  }
  catch (QueryParameterException e) {
    throw new IllegalArgumentException( e );
  }
  catch (HibernateException he) {
    throw getEntityManager().convert( he );
  }
}

代码示例来源:origin: ezbz/projectx

@Override
public Query setTime(final int position, final Date date) {
 return query.setTime(position, date);
}

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate.ejb

/**
 * {@inheritDoc}
 */
public TypedQuery<X> setParameter(int position, Date value, TemporalType temporalType) {
  try {
    if ( isJpaPositionalParameter( position ) ) {
      String name = Integer.toString( position );
      this.setParameter( name, value, temporalType );
    }
    else {
      if ( temporalType == DATE ) {
        query.setDate( position - 1, value );
      }
      else if ( temporalType == TIME ) {
        query.setTime( position - 1, value );
      }
      else if ( temporalType == TIMESTAMP ) {
        query.setTimestamp( position - 1, value );
      }
      registerParameterBinding( getParameter( position ), value );
    }
    return this;
  }
  catch (QueryParameterException e) {
    throw new IllegalArgumentException( e );
  }
  catch (HibernateException he) {
    throw getEntityManager().convert( he );
  }
}

代码示例来源:origin: ezbz/projectx

@Override
public Query setTime(final String name, final Date date) {
 return query.setTime(name, date);
}

代码示例来源:origin: riotfamily/riot

public TypedQuery<T> setTime(int position, Date date) {
  query.setTime(position, date);
  return this;
}

代码示例来源:origin: riotfamily/riot

public TypedQuery<T> setTime(String name, Date date) {
  query.setTime(name, date);
  return this;
}

相关文章