Package org.hibernate.annotations
Enum ResultCheckStyle
- java.lang.Object
-
- java.lang.Enum<ResultCheckStyle>
-
- org.hibernate.annotations.ResultCheckStyle
-
- All Implemented Interfaces:
Serializable
,Comparable<ResultCheckStyle>
public enum ResultCheckStyle extends Enum<ResultCheckStyle>
Enumerates strategies for checking JDBC return codes for custom SQL DML queries.Return code checking is used to verify that a SQL statement actually had the intended effect, for example, that an
UPDATE
statement actually changed the expected number of rows.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description COUNT
Row count checking.NONE
No return code checking.PARAM
Essentially identical toCOUNT
except that the row count is obtained via an output parameter of astored procedure
.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ResultCheckStyle
valueOf(String name)
Returns the enum constant of this type with the specified name.static ResultCheckStyle[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
NONE
public static final ResultCheckStyle NONE
No return code checking. Might mean that no checks are required, or that failure is indicated by aSQLException
being thrown, for example, by astored procedure
which performs explicit checks.
-
COUNT
public static final ResultCheckStyle COUNT
Row count checking. A row count is an integer value returned byPreparedStatement.executeUpdate()
orStatement.executeBatch()
. The row count is checked against an expected value. For example, the expected row count for anINSERT
statement is always 1.
-
PARAM
public static final ResultCheckStyle PARAM
Essentially identical toCOUNT
except that the row count is obtained via an output parameter of astored procedure
.Statement batching is disabled when
PARAM
is selected.
-
-
Method Detail
-
values
public static ResultCheckStyle[] 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 (ResultCheckStyle c : ResultCheckStyle.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ResultCheckStyle 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
-
-