Package org.hibernate
Enum ConnectionAcquisitionMode
- java.lang.Object
-
- java.lang.Enum<ConnectionAcquisitionMode>
-
- org.hibernate.ConnectionAcquisitionMode
-
- All Implemented Interfaces:
Serializable
,Comparable<ConnectionAcquisitionMode>
public enum ConnectionAcquisitionMode extends Enum<ConnectionAcquisitionMode>
Indicates the manner in which JDBC connections are acquired. Complementary toConnectionReleaseMode
.- See Also:
PhysicalConnectionHandlingMode
-
-
Enum Constant Summary
Enum Constants Enum Constant Description AS_NEEDED
AConnection
is acquired only when (and if) it's actually needed.IMMEDIATELY
TheConnection
will be acquired as soon as a session is opened.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ConnectionAcquisitionMode
interpret(Object setting)
static ConnectionAcquisitionMode
interpret(String value)
static ConnectionAcquisitionMode
valueOf(String name)
Returns the enum constant of this type with the specified name.static ConnectionAcquisitionMode[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
IMMEDIATELY
public static final ConnectionAcquisitionMode IMMEDIATELY
TheConnection
will be acquired as soon as a session is opened.This circumvents the
ConnectionReleaseMode
, as theConnection
will then be held until the session is closed.
-
AS_NEEDED
public static final ConnectionAcquisitionMode AS_NEEDED
AConnection
is acquired only when (and if) it's actually needed.This is the default (and legacy) behavior.
-
-
Method Detail
-
values
public static ConnectionAcquisitionMode[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (ConnectionAcquisitionMode c : ConnectionAcquisitionMode.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ConnectionAcquisitionMode valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
interpret
public static ConnectionAcquisitionMode interpret(String value)
-
interpret
public static ConnectionAcquisitionMode interpret(Object setting)
-
-