Package org.nuxeo.ecm.core.storage.sql
Class CollectionFragment
java.lang.Object
org.nuxeo.ecm.core.storage.sql.Fragment
org.nuxeo.ecm.core.storage.sql.CollectionFragment
- All Implemented Interfaces:
Serializable
A type of fragment corresponding to several rows with the same id.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.nuxeo.ecm.core.storage.sql.Fragment
Fragment.State -
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionCollectionFragment(Row row, Fragment.State state, PersistenceContext context) Constructs aCollectionFragmentfrom aRow. -
Method Summary
Modifier and TypeMethodDescriptionget()Gets the collection value.Returns the row update to do in the database to write this value.booleanisDirty()Checks if the array is dirty (values changed since last clear).static booleanisPrefix(Serializable[] left, Serializable[] right) Checks if the left array is a strict prefix of the right one.protected Fragment.Staterefetch()Refetches this fragment from the database.protected Fragment.StateResets the data for a fragment that was invalidated by deletion.voidset(Serializable[] value) Sets a collection value.Methods inherited from class org.nuxeo.ecm.core.storage.sql.Fragment
accessed, clearDirty, getId, getState, markModified, setDeleted, setDetached, setId, setInvalidatedDeleted, setInvalidatedModified, setPristine, toString
-
Constructor Details
-
CollectionFragment
Constructs aCollectionFragmentfrom aRow.- Parameters:
row- the rowstate- the initial state for the fragmentcontext- the persistence context to which the fragment is tied, ornull
-
-
Method Details
-
set
Sets a collection value.- Parameters:
value- the value
-
get
Gets the collection value.- Returns:
- the value
-
isDirty
public boolean isDirty()Checks if the array is dirty (values changed since last clear).- Returns:
trueif the array changed
-
getRowUpdate
Description copied from class:FragmentReturns the row update to do in the database to write this value.- Specified by:
getRowUpdatein classFragment- Returns:
- a row update, or
nullif the value is unchanged since last clear
-
isPrefix
Checks if the left array is a strict prefix of the right one.- Since:
- 8.3
-
refetch
Description copied from class:FragmentRefetches this fragment from the database. Needed when an invalidation has been received and the fragment is accessed again.- Specified by:
refetchin classFragment- Returns:
- the new state,
Fragment.State.PRISTINEorFragment.State.ABSENT
-
refetchDeleted
Description copied from class:FragmentResets the data for a fragment that was invalidated by deletion.- Specified by:
refetchDeletedin classFragment- Returns:
- the new state,
Fragment.State.PRISTINEorFragment.State.ABSENT
-