/** * Interpret the configured {@link ImmutableEntityUpdateQueryHandlingMode} value. * Valid values are either a {@link ImmutableEntityUpdateQueryHandlingMode} object or its String representation. * For string values, the matching is case insensitive, * so you can use either {@code warning} or {@code exception} (case insensitive). * * @param mode configured {@link ImmutableEntityUpdateQueryHandlingMode} representation * @return associated {@link ImmutableEntityUpdateQueryHandlingMode} object */ public static ImmutableEntityUpdateQueryHandlingMode interpret(Object mode) { if ( mode == null ) { return WARNING; } else if ( mode instanceof ImmutableEntityUpdateQueryHandlingMode ) { return (ImmutableEntityUpdateQueryHandlingMode) mode; } else if ( mode instanceof String ) { for ( ImmutableEntityUpdateQueryHandlingMode value : values() ) { if ( value.name().equalsIgnoreCase( (String) mode ) ) { return value; } } } throw new HibernateException( "Unrecognized immutable_entity_update_query_handling_mode value : " + mode + ". Supported values include 'warning' and 'exception''." ); } }
); this.immutableEntityUpdateQueryHandlingMode = ImmutableEntityUpdateQueryHandlingMode.interpret( configurationSettings.get( IMMUTABLE_ENTITY_UPDATE_QUERY_HANDLING_MODE ) );
); this.immutableEntityUpdateQueryHandlingMode = ImmutableEntityUpdateQueryHandlingMode.interpret( configurationSettings.get( IMMUTABLE_ENTITY_UPDATE_QUERY_HANDLING_MODE ) );
/** * Interpret the configured {@link ImmutableEntityUpdateQueryHandlingMode} value. * Valid values are either a {@link ImmutableEntityUpdateQueryHandlingMode} object or its String representation. * For string values, the matching is case insensitive, * so you can use either {@code warning} or {@code exception} (case insensitive). * * @param mode configured {@link ImmutableEntityUpdateQueryHandlingMode} representation * @return associated {@link ImmutableEntityUpdateQueryHandlingMode} object */ public static ImmutableEntityUpdateQueryHandlingMode interpret(Object mode) { if ( mode == null ) { return WARNING; } else if ( mode instanceof ImmutableEntityUpdateQueryHandlingMode ) { return (ImmutableEntityUpdateQueryHandlingMode) mode; } else if ( mode instanceof String ) { for ( ImmutableEntityUpdateQueryHandlingMode value : values() ) { if ( value.name().equalsIgnoreCase( (String) mode ) ) { return value; } } } throw new HibernateException( "Unrecognized immutable_entity_update_query_handling_mode value : " + mode + ". Supported values include 'warning' and 'exception''." ); } }