Package org.apache.openjpa.slice
Class SlicePersistence
- java.lang.Object
-
- org.apache.openjpa.slice.SlicePersistence
-
public class SlicePersistence extends java.lang.Object
A helper to determine the slice identifier of an instance.- Author:
- Pinaki Poddar
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
HINT_TARGET
The key for setting the Query hints.
-
Constructor Summary
Constructors Constructor Description SlicePersistence()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.String
getSlice(java.lang.Object obj)
Get the slice identifier for the given instance if it is a managed instance and has been assigned to a slice.static boolean
isReplicated(java.lang.Object obj)
Affirms if the given instance is replicated, provided the given instance is managed.
-
-
-
Field Detail
-
HINT_TARGET
public static final java.lang.String HINT_TARGET
The key for setting the Query hints. The value is comma-separated Slice names. If the hint is specified then the query is executed only on the listed slices.- See Also:
- Constant Field Values
-
-
Method Detail
-
getSlice
public static java.lang.String getSlice(java.lang.Object obj)
Get the slice identifier for the given instance if it is a managed instance and has been assigned to a slice. If the given instance is replicated across multiple slices then returns comma-separated list of slice names.- Returns:
- name of the slice, if any. null otherwise.
-
isReplicated
public static boolean isReplicated(java.lang.Object obj)
Affirms if the given instance is replicated, provided the given instance is managed.
-
-