public String toString(Map<String, TypedValue> namedTypedValues) throws HibernateException { Map<String, String> result = new HashMap<String, String>(); for ( Map.Entry<String, TypedValue> entry : namedTypedValues.entrySet() ) { result.put( entry.getKey(), entry.getValue().getType().toLoggableString( entry.getValue().getValue(), factory ) ); } return result.toString(); }
@Override public int bind( PreparedStatement statement, QueryParameters qp, SharedSessionContractImplementor session, int position) throws SQLException { final Object value = qp.getNamedParameters().get( PARAM_KEY ).getValue(); keyType.nullSafeSet( statement, value, position, session ); return keyType.getColumnSpan( session.getFactory() ); }
@Override public int bind( PreparedStatement statement, QueryParameters qp, SharedSessionContractImplementor session, int position) throws SQLException { final TypedValue typedValue = qp.getNamedParameters().get( Integer.toString( label ) ); typedValue.getType().nullSafeSet( statement, typedValue.getValue(), position, session ); return typedValue.getType().getColumnSpan( session.getFactory() ); } }
@Override public int bind( PreparedStatement statement, QueryParameters qp, SharedSessionContractImplementor session, int position) throws SQLException { final TypedValue typedValue = qp.getNamedParameters().get( Integer.toString( label ) ); typedValue.getType().nullSafeSet( statement, typedValue.getValue(), position, session ); return typedValue.getType().getColumnSpan( session.getFactory() ); } }
@Override public int bind( PreparedStatement statement, QueryParameters qp, SharedSessionContractImplementor session, int position) throws SQLException { final TypedValue typedValue = qp.getNamedParameters().get( name ); typedValue.getType().nullSafeSet( statement, typedValue.getValue(), position, session ); return typedValue.getType().getColumnSpan( session.getFactory() ); } }
/** * Bind the appropriate value into the given statement at the specified position. * * @param statement The statement into which the value should be bound. * @param qp The defined values for the current query execution. * @param session The session against which the current execution is occuring. * @param position The position from which to start binding value(s). * * @return The number of sql bind positions "eaten" by this bind operation. */ @Override public int bind(PreparedStatement statement, QueryParameters qp, SharedSessionContractImplementor session, int position) throws SQLException { final TypedValue typedValue = qp.getNamedParameters().get( Integer.toString( label ) ); typedValue.getType().nullSafeSet( statement, typedValue.getValue(), position, session ); return typedValue.getType().getColumnSpan( session.getFactory() ); }
@Override public int bind( PreparedStatement statement, QueryParameters qp, SharedSessionContractImplementor session, int position) throws SQLException { final TypedValue typedValue = qp.getNamedParameters().get( name ); typedValue.getType().nullSafeSet( statement, typedValue.getValue(), position, session ); return typedValue.getType().getColumnSpan( session.getFactory() ); } }
/** * Bind the appropriate value into the given statement at the specified position. * * @param statement The statement into which the value should be bound. * @param qp The defined values for the current query execution. * @param session The session against which the current execution is occuring. * @param position The position from which to start binding value(s). * * @return The number of sql bind positions "eaten" by this bind operation. */ @Override public int bind( PreparedStatement statement, QueryParameters qp, SharedSessionContractImplementor session, int position) throws SQLException { TypedValue typedValue = qp.getNamedParameters().get( name ); typedValue.getType().nullSafeSet( statement, typedValue.getValue(), position, session ); return typedValue.getType().getColumnSpan( session.getFactory() ); }
namedParameterEntry.getValue().getType(), namedParameterEntry.getValue().getType().disassemble( namedParameterEntry.getValue().getValue(), session, null
final TypedValue[] tv = subcriteria.getWithClause().getTypedValues( subcriteria, this ); for ( TypedValue aTv : tv ) { values.add( aTv.getValue() ); types.add( aTv.getType() ); final TypedValue[] tv = ce.getCriterion().getTypedValues( ce.getCriteria(), this ); for ( TypedValue aTv : tv ) { values.add( aTv.getValue() ); types.add( aTv.getType() );
/** * Unwraps the given named parameters if they are wrapped into {@link TypedValue}s. * * @param namedParameters the original named parameters * @return the unwrapped named parameters */ protected Map<String, Object> unwrap(Map<String, Object> namedParameters) { Map<String, Object> unwrapped = new HashMap<String, Object>( namedParameters.size() ); for ( Entry<String, Object> entry : namedParameters.entrySet() ) { Object value = entry.getValue(); unwrapped.put( entry.getKey(), value instanceof TypedValue ? ( (TypedValue) value ).getValue() : value ); } return unwrapped; } }
/** * Returns a map with the named parameter values from the given parameters object, converted by the {@link GridType} * corresponding to each parameter type. */ private Map<String, Object> getNamedParameterValuesConvertedByGridType(QueryParameters queryParameters) { Map<String, Object> parameterValues = new HashMap<String, Object>( queryParameters.getNamedParameters().size() ); for ( Entry<String, TypedValue> parameter : queryParameters.getNamedParameters().entrySet() ) { parameterValues.put( parameter.getKey(), parameter.getValue().getValue() ); } return parameterValues; }
public String toString(Map<String,TypedValue> namedTypedValues) throws HibernateException { Map<String,String> result = new HashMap<String,String>(); for ( Map.Entry<String, TypedValue> entry : namedTypedValues.entrySet() ) { result.put( entry.getKey(), entry.getValue().getType().toLoggableString( entry.getValue().getValue(), factory ) ); } return result.toString(); }
public String toString(Map<String, TypedValue> namedTypedValues) throws HibernateException { Map<String, String> result = new HashMap<String, String>(); for ( Map.Entry<String, TypedValue> entry : namedTypedValues.entrySet() ) { result.put( entry.getKey(), entry.getValue().getType().toLoggableString( entry.getValue().getValue() ) ); } return result.toString(); }
public String toString(Map<String,TypedValue> namedTypedValues) throws HibernateException { Map<String,String> result = new HashMap<String,String>(); for ( Map.Entry<String, TypedValue> entry : namedTypedValues.entrySet() ) { result.put( entry.getKey(), entry.getValue().getType().toLoggableString( entry.getValue().getValue(), factory ) ); } return result.toString(); }
private Map<String, Object> getNamedParameterValues(QueryParameters queryParameters) { Map<String, Object> parameterValues = new HashMap<String, Object>( queryParameters.getNamedParameters().size() ); for ( Entry<String, TypedValue> parameter : queryParameters.getNamedParameters().entrySet() ) { parameterValues.put( parameter.getKey(), parameter.getValue().getValue() ); } return parameterValues; }
public static TypedGridValue fromOrmTypedValue(TypedValue typedValue, TypeTranslator typeTranslator, SessionFactoryImplementor factory) { GridType gridType = typeTranslator.getType( typedValue.getType() ); Object backendValue = gridType.convertToBackendType( typedValue.getValue(), factory ); return new TypedGridValue( gridType, backendValue ); }