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
public class CollectionFragment extends Fragment
A type of fragment corresponding to several rows with the same id.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.nuxeo.ecm.core.storage.sql.Fragment
Fragment.State
-
-
Constructor Summary
Constructors Constructor Description CollectionFragment(Row row, Fragment.State state, PersistenceContext context)
Constructs aCollectionFragment
from aRow
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Serializable[]
get()
Gets the collection value.RowMapper.RowUpdate
getRowUpdate()
Returns the row update to do in the database to write this value.boolean
isDirty()
Checks if the array is dirty (values changed since last clear).static boolean
isPrefix(Serializable[] left, Serializable[] right)
Checks if the left array is a strict prefix of the right one.protected Fragment.State
refetch()
Refetches this fragment from the database.protected Fragment.State
refetchDeleted()
Resets the data for a fragment that was invalidated by deletion.void
set(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 Detail
-
CollectionFragment
public CollectionFragment(Row row, Fragment.State state, PersistenceContext context)
Constructs aCollectionFragment
from aRow
.- Parameters:
row
- the rowstate
- the initial state for the fragmentcontext
- the persistence context to which the fragment is tied, ornull
-
-
Method Detail
-
set
public void set(Serializable[] value)
Sets a collection value.- Parameters:
value
- the value
-
get
public Serializable[] get()
Gets the collection value.- Returns:
- the value
-
isDirty
public boolean isDirty()
Checks if the array is dirty (values changed since last clear).- Returns:
true
if the array changed
-
getRowUpdate
public RowMapper.RowUpdate getRowUpdate()
Description copied from class:Fragment
Returns the row update to do in the database to write this value.- Specified by:
getRowUpdate
in classFragment
- Returns:
- a row update, or
null
if the value is unchanged since last clear
-
isPrefix
public static boolean isPrefix(Serializable[] left, Serializable[] right)
Checks if the left array is a strict prefix of the right one.- Since:
- 8.3
-
refetch
protected Fragment.State refetch()
Description copied from class:Fragment
Refetches this fragment from the database. Needed when an invalidation has been received and the fragment is accessed again.- Specified by:
refetch
in classFragment
- Returns:
- the new state,
Fragment.State.PRISTINE
orFragment.State.ABSENT
-
refetchDeleted
protected Fragment.State refetchDeleted()
Description copied from class:Fragment
Resets the data for a fragment that was invalidated by deletion.- Specified by:
refetchDeleted
in classFragment
- Returns:
- the new state,
Fragment.State.PRISTINE
orFragment.State.ABSENT
-
-