Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.ecm.core.storage.sql
Class SimpleFragment

java.lang.Object
  extended by org.nuxeo.ecm.core.storage.sql.Fragment
      extended by org.nuxeo.ecm.core.storage.sql.SimpleFragment
All Implemented Interfaces:
Serializable

public final class SimpleFragment
extends Fragment

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:
Serialized Form

Nested Class Summary
static class SimpleFragment.FieldComparator
          Comparator of SimpleFragments according to a field.
 
Nested classes/interfaces inherited from class org.nuxeo.ecm.core.storage.sql.Fragment
Fragment.State
 
Field Summary
static SimpleFragment UNKNOWN
           
 
Constructor Summary
SimpleFragment(Row row, Fragment.State state, PersistenceContext context)
          Constructs a SimpleFragment from a Row.
 
Method Summary
 Serializable get(String key)
          Gets a value by key.
 List<String> getDirtyKeys()
          Gets the dirty keys (keys of values changed since last clear).
 String getString(String key)
          Returns a String value.
 void put(String key, Serializable value)
          Puts a value by key.
 
Methods inherited from class org.nuxeo.ecm.core.storage.sql.Fragment
clearDirty, getId, getState, setId, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

UNKNOWN

public static final SimpleFragment UNKNOWN
Constructor Detail

SimpleFragment

public SimpleFragment(Row row,
                      Fragment.State state,
                      PersistenceContext context)
Constructs a SimpleFragment from a Row.

Parameters:
row - the row, or null
state - the initial state for the fragment
context - the persistence context to which the fragment is tied, or null
Method Detail

get

public Serializable get(String key)
                 throws StorageException
Gets a value by key.

Parameters:
key - the key
Returns:
the value
Throws:
StorageException

put

public void put(String key,
                Serializable value)
         throws StorageException
Puts a value by key.

Parameters:
key - the key
value - the value
Throws:
StorageException

getString

public String getString(String key)
                 throws StorageException
Returns a String value.

Parameters:
key - the key
Returns:
the value as a String
Throws:
ClassCastException - if the value is not a String
StorageException

getDirtyKeys

public List<String> getDirtyKeys()
Gets the dirty keys (keys of values changed since last clear).

Returns:
the dirty keys

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.