public final class SimpleFragment extends Fragment
Modifier and Type | Class and Description |
---|---|
static class |
SimpleFragment.FieldComparator
Comparator of
SimpleFragment s according to a field. |
Fragment.State
Modifier and Type | Field and Description |
---|---|
static SimpleFragment |
UNKNOWN |
Constructor and Description |
---|
SimpleFragment(Row row,
Fragment.State state,
PersistenceContext context)
Constructs a
SimpleFragment from a Row . |
Modifier and Type | Method and Description |
---|---|
Serializable |
get(String key)
Gets a value by key.
|
List<String> |
getDirtyKeys()
Gets the dirty keys (keys of values changed since last clear).
|
RowMapper.RowUpdate |
getRowUpdate()
Returns the row update to do in the database to write this value.
|
String |
getString(String key)
Returns a
String value. |
void |
put(String key,
Serializable value)
Puts a value by key.
|
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.
|
accessed, clearDirty, getId, getState, markModified, setDeleted, setDetached, setId, setInvalidatedDeleted, setInvalidatedModified, setPristine, toString
public static final SimpleFragment UNKNOWN
public SimpleFragment(Row row, Fragment.State state, PersistenceContext context)
SimpleFragment
from a Row
.row
- the row, or null
state
- the initial state for the fragmentcontext
- the persistence context to which the fragment is tied, or null
protected Fragment.State refetch()
Fragment
refetch
in class Fragment
Fragment.State.PRISTINE
or Fragment.State.ABSENT
protected Fragment.State refetchDeleted()
Fragment
refetchDeleted
in class Fragment
Fragment.State.PRISTINE
or Fragment.State.ABSENT
public Serializable get(String key)
key
- the keypublic void put(String key, Serializable value)
key
- the keyvalue
- the valuepublic String getString(String key)
String
value.key
- the keyString
ClassCastException
- if the value is not a String
public RowMapper.RowUpdate getRowUpdate()
Fragment
getRowUpdate
in class Fragment
null
if the value is unchanged since last clearpublic List<String> getDirtyKeys()
Copyright © 2017 Nuxeo. All rights reserved.