Package org.hibernate.query.sqm
Enum ConstructorEntityArgumentMode
- java.lang.Object
-
- java.lang.Enum<ConstructorEntityArgumentMode>
-
- org.hibernate.query.sqm.ConstructorEntityArgumentMode
-
- All Implemented Interfaces:
Serializable
,Comparable<ConstructorEntityArgumentMode>
public enum ConstructorEntityArgumentMode extends Enum<ConstructorEntityArgumentMode>
Describes the allowable ways in which entity references can be handled as dynamic-instantiation (ctor result) argument.NOTE that this only applies to Hibernate extension to JPA. JPA does not allow ctor-result arguments to be anything other than scalar values (column result).
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ConstructorEntityArgumentMode
valueOf(String name)
Returns the enum constant of this type with the specified name.static ConstructorEntityArgumentMode[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
SCALAR
public static final ConstructorEntityArgumentMode SCALAR
The id of the entity will be used as the ctor arg. This is the legacy Hibernate behavior.
-
ENTITY
public static final ConstructorEntityArgumentMode ENTITY
The entity reference will be passed as the ctor arg. Whether the entity ref is initialized or not depends on whether the entity is fetched in the query or is otherwise already part of the persistence context.
-
CHOOSE
public static final ConstructorEntityArgumentMode CHOOSE
This mode says to chose based on what ctors are available on the target class.
-
-
Method Detail
-
values
public static ConstructorEntityArgumentMode[] 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 (ConstructorEntityArgumentMode c : ConstructorEntityArgumentMode.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ConstructorEntityArgumentMode 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
-
-