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

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

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

Query.setCalendar介绍

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

代码示例

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

@Override
public Query setCalendar(String s, Calendar calendar) {
  return query.setCalendar(s, calendar);
}

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

public Query setParameter(String name, Calendar value, TemporalType temporalType) {
  try {
    if ( temporalType == DATE ) {
      query.setCalendarDate( name, value );
    }
    else if ( temporalType == TIME ) {
      throw new IllegalArgumentException( "not yet implemented" );
    }
    else if ( temporalType == TIMESTAMP ) {
      query.setCalendar( 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, Calendar value, TemporalType temporalType) {
  try {
    if ( isPositionalParameter() ) {
      String name = Integer.toString( position );
      this.setParameter( name, value, temporalType );
    }
    else {
      if ( temporalType == DATE ) {
        query.setCalendarDate( position - 1, value );
      }
      else if ( temporalType == TIME ) {
        throw new IllegalArgumentException( "not yet implemented" );
      }
      else if ( temporalType == TIMESTAMP ) {
        query.setCalendar( position - 1, value );
      }
    }
    return this;
  }
  catch (QueryParameterException e) {
    throw new IllegalArgumentException( e );
  }
  catch (HibernateException he) {
    em.throwPersistenceException( he );
    return null;
  }
}

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

public TypedQuery<T> setCalendar(int position, Calendar calendar) {
  query.setCalendar(position, calendar);
  return this;
}

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

/**
 * {@inheritDoc}
 */
public TypedQuery<X> setParameter(String name, Calendar value, TemporalType temporalType) {
  try {
    if ( temporalType == DATE ) {
      query.setCalendarDate( name, value );
    }
    else if ( temporalType == TIME ) {
      throw new IllegalArgumentException( "not yet implemented" );
    }
    else if ( temporalType == TIMESTAMP ) {
      query.setCalendar( 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 setCalendar(final String name, final Calendar calendar) {
 return query.setCalendar(name, calendar);
}

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

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

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

@Override
public Query setCalendar(int i, Calendar calendar) {
  return query.setCalendar(i, calendar);
}

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

public TypedQuery<T> setCalendar(String name, Calendar calendar) {
  query.setCalendar(name, calendar);
  return this;
}

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

@Override
public Query setCalendar(final int position, final Calendar calendar) {
 return query.setCalendar(position, calendar);
}

相关文章