org.hibernate.type.TextType Java Examples

The following examples show how to use org.hibernate.type.TextType. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: JsonType.java    From jstarcraft-core with Apache License 2.0 5 votes vote down vote up
@Override
public void nullSafeSet(PreparedStatement preparedStatement, Object value, int index, SharedSessionContractImplementor session) throws HibernateException, SQLException {
    if (value != null) {
        String json;
        synchronized (value) {
            json = value instanceof String ? (String) value : JsonUtility.object2String(value);
        }
        preparedStatement.setString(index, json);
    } else {
        preparedStatement.setNull(index, TextType.INSTANCE.sqlType());
    }
}
 
Example #2
Source File: JsonType.java    From jstarcraft-core with Apache License 2.0 4 votes vote down vote up
@Override
public int[] sqlTypes() {
    return new int[] { TextType.INSTANCE.sqlType() };
}
 
Example #3
Source File: Query.java    From lams with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Bind a positional String-valued parameter using streaming.
 *
 * @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> setText(int position, String val) {
	setParameter( position, val, TextType.INSTANCE );
	return this;
}
 
Example #4
Source File: Query.java    From lams with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Bind a named String-valued parameter using streaming.
 *
 * @param name The parameter name
 * @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> setText(String name, String val) {
	setParameter( name, val, TextType.INSTANCE );
	return this;
}
 
Example #5
Source File: Query.java    From lams with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Bind a named Locale-valued parameter.
 *
 * @param name The parameter name
 * @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> setLocale(String name, Locale val) {
	setParameter( name, val, TextType.INSTANCE );
	return this;
}
 
Example #6
Source File: Query.java    From lams with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Bind a positional String-valued parameter using streaming.
 *
 * @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> setText(int position, String val) {
	setParameter( position, val, TextType.INSTANCE );
	return this;
}
 
Example #7
Source File: Query.java    From lams with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Bind a named String-valued parameter using streaming.
 *
 * @param name The parameter name
 * @param val The bind value
 *
 * @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> setText(String name, String val) {
	setParameter( name, val, TextType.INSTANCE );
	return this;
}
 
Example #8
Source File: Query.java    From lams with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Bind a named Locale-valued parameter.
 *
 * @param name The parameter name
 * @param val The bind value
 *
 * @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> setLocale(String name, Locale val) {
	setParameter( name, val, TextType.INSTANCE );
	return this;
}