org.hibernate.type.BinaryType Java Examples

The following examples show how to use org.hibernate.type.BinaryType. 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: SimpleValue.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
public Type getType() throws MappingException {
	if ( type != null ) {
		return type;
	}

	if ( typeName == null ) {
		throw new MappingException( "No type name" );
	}

	if ( typeParameters != null
			&& Boolean.valueOf( typeParameters.getProperty( DynamicParameterizedType.IS_DYNAMIC ) )
			&& typeParameters.get( DynamicParameterizedType.PARAMETER_TYPE ) == null ) {
		createParameterImpl();
	}

	Type result = getMetadata().getTypeConfiguration().getTypeResolver().heuristicType( typeName, typeParameters );
	// if this is a byte[] version/timestamp, then we need to use RowVersionType
	// instead of BinaryType (HHH-10413)
	if ( isVersion && BinaryType.class.isInstance( result ) ) {
		log.debug( "version is BinaryType; changing to RowVersionType" );
		result = RowVersionType.INSTANCE;
	}
	if ( result == null ) {
		String msg = "Could not determine type for: " + typeName;
		if ( table != null ) {
			msg += ", at table: " + table.getName();
		}
		if ( columns != null && columns.size() > 0 ) {
			msg += ", for columns: " + columns;
		}
		throw new MappingException( msg );
	}

	return result;
}
 
Example #2
Source File: SessionBackup.java    From unitime with Apache License 2.0 4 votes vote down vote up
boolean hasBlob() {
	for (String property: iMeta.getPropertyNames()) {
		if (iMeta.getPropertyType(property) instanceof BinaryType) return true;
	}
	return false;
}
 
Example #3
Source File: Query.java    From lams with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Bind a positional binary-valued parameter.
 *
 * @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> setBinary(int position, byte[] val) {
	setParameter( position, val, BinaryType.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 binary-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> setBinary(String name, byte[] val) {
	setParameter( name, val, BinaryType.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 positional binary-valued parameter.
 *
 * @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> setBinary(int position, byte[] val) {
	setParameter( position, val, BinaryType.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 named binary-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> setBinary(String name, byte[] val) {
	setParameter( name, val, BinaryType.INSTANCE );
	return this;
}