- All Implemented Interfaces:
- Serializable,- Comparable<PersistenceContextScope>
Defines the scope for PersistenceContext.
 
 Ebean has traditionally used Transaction scope for the PersistenceContext. This is used to change the scope to
 use (by default) and explicitly set the scope to use for an individual query.
- 
Enum Constant SummaryEnum ConstantsEnum ConstantDescriptionPersistenceContext is scoped to the query.PersistenceContext is scoped to the transaction.
- 
Method SummaryModifier and TypeMethodDescriptionstatic PersistenceContextScopeReturns the enum constant of this type with the specified name.static PersistenceContextScope[]values()Returns an array containing the constants of this enum type, in the order they are declared.
- 
Enum Constant Details- 
TRANSACTIONPersistenceContext is scoped to the transaction. If a transaction spans 2 or more queries that fetch the same bean in terms of same type and same Id value then they share the same bean instance. You may want to change to use QUERY scope when you want a query executing in a transaction to effectively ignore beans that have already been loaded (by other queries in the same transaction) and instead get a 'fresh copy' of the bean.
- 
QUERYPersistenceContext is scoped to the query. This means that for this query running in an existing transaction then it will effectively ignore any beans that have already been queried/loaded by prior queries in the same transaction. You may use QUERY scope on a query that is executed in a transaction and you want to get a 'fresh copy' of the bean.
 
- 
- 
Method Details- 
valuesReturns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
 
- 
valueOfReturns 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 name
- NullPointerException- if the argument is null
 
 
-