下面列出了怎么用org.hibernate.type.TimeType的API类实例代码及写法,或者点击链接到github查看源代码。
@Override
public final TimeType getHibernateType() {
return TimeType.INSTANCE;
}
/**
* Bind a positional Date-valued parameter using just the Time portion.
*
* @param position The parameter position
* @param val The bind value
*
* @return {@code this}, for method chaining
*
* @deprecated (since 5.2) use {@link #setParameter(int, Object)} or {@link #setParameter(int, Object, Type)}
* instead
*/
@Deprecated
@SuppressWarnings("unchecked")
default Query<R> setTime(int position, Date val) {
setParameter( position, val, TimeType.INSTANCE );
return this;
}
/**
* Bind the time (val is truncated) of a given Date object to a named query parameter.
*
* @param name The name of the parameter
* @param val The val object
*
* @return {@code this}, for method chaining
*
* @deprecated (since 5.2) use {@link #setParameter(int, Object)} or {@link #setParameter(int, Object, Type)}
* instead
*/
@Deprecated
@SuppressWarnings("unchecked")
default Query<R> setTime(String name, Date val) {
setParameter( name, val, TimeType.INSTANCE );
return this;
}
/**
* Bind a positional Date-valued parameter using just the Time portion.
*
* @param position The parameter position
* @param val The bind value
*
* @return {@code this}, for method chaining
*
* @deprecated (since 5.2) use {@link #setParameter(int, Object)} or {@link #setParameter(int, Object, Type)}
* instead
*/
@Deprecated
@SuppressWarnings("unchecked")
default Query<R> setTime(int position, Date val) {
setParameter( position, val, TimeType.INSTANCE );
return this;
}
/**
* Bind the time (val is truncated) of a given Date object to a named query parameter.
*
* @param name The name of the parameter
* @param val The val object
*
* @return {@code this}, for method chaining
*
* @deprecated (since 5.2) use {@link #setParameter(String, Object)} or {@link #setParameter(String, Object, Type)}
* instead
*/
@Deprecated
@SuppressWarnings("unchecked")
default Query<R> setTime(String name, Date val) {
setParameter( name, val, TimeType.INSTANCE );
return this;
}