Package org.nuxeo.ecm.core.storage.sql
Class SimpleFragment
java.lang.Object
org.nuxeo.ecm.core.storage.sql.Fragment
org.nuxeo.ecm.core.storage.sql.SimpleFragment
- All Implemented Interfaces:
Serializable
A type of fragment corresponding to a single row in a table and its associated in-memory information (state, dirty
fields, attached context).
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classComparator ofSimpleFragments according to a field.Nested classes/interfaces inherited from class org.nuxeo.ecm.core.storage.sql.Fragment
Fragment.State -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSimpleFragment(Row row, Fragment.State state, PersistenceContext context) Constructs aSimpleFragmentfrom aRow. -
Method Summary
Modifier and TypeMethodDescriptionGets a value by key.Gets the dirty keys (keys of values changed since last clear).Returns the row update to do in the database to write this value.Returns aStringvalue.voidput(String key, Serializable value) Puts a value by key.protected Fragment.Staterefetch()Refetches this fragment from the database.protected Fragment.StateResets the data for a fragment that was invalidated by deletion.Methods inherited from class org.nuxeo.ecm.core.storage.sql.Fragment
accessed, clearDirty, getId, getState, markModified, setDeleted, setDetached, setId, setInvalidatedDeleted, setInvalidatedModified, setPristine, toString
-
Field Details
-
UNKNOWN
-
-
Constructor Details
-
SimpleFragment
Constructs aSimpleFragmentfrom aRow.- Parameters:
row- the row, ornullstate- the initial state for the fragmentcontext- the persistence context to which the fragment is tied, ornull
-
-
Method Details
-
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
-
get
Gets a value by key.- Parameters:
key- the key- Returns:
- the value
-
put
Puts a value by key.- Parameters:
key- the keyvalue- the value
-
getString
Returns aStringvalue.- Parameters:
key- the key- Returns:
- the value as a
String - Throws:
ClassCastException- if the value is not aString
-
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
-
getDirtyKeys
Gets the dirty keys (keys of values changed since last clear).- Returns:
- the dirty keys
-