Package org.nuxeo.ecm.core.storage.sql
Class Node
java.lang.Object
org.nuxeo.ecm.core.storage.sql.Node
- All Implemented Interfaces:
StateAccessor
A
Node implementation. The actual data is stored in contained objects that are Fragments.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final org.nuxeo.ecm.core.storage.sql.FragmentsMapFragment information for each additional mixin or inherited fragment.protected final SimpleFragmentThe hierarchy/main fragment.protected StringPath, only for immediate consumption after construction (will be reset to null afterwards). -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedNode(PersistenceContext context, org.nuxeo.ecm.core.storage.sql.FragmentGroup fragmentGroup, String path) Creates a Node. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidClears the properties cache, used when removing mixins.booleanGets the mixins.Object[]Gets an array value.getCollectionProperty(String name) Gets a collection property from the node, given its name.protected SimpleFragmentgetId()Gets the node unique id, usually a Long or a String.String[]Gets the instance mixins.getName()getPath()Gets the path that was assigned atNodeconstruction time.getPos()protected ModelPropertygetPropertyInfo(String name) String[]Gets the retained properties.getSimpleProperty(String name) Gets a simple property from the node, given its name.Gets a single value.inthashCode()booleanhasMixinType(String mixin) Checks the mixins.booleanbooleanisProxy()booleanisRecord()booleanprotected CollectionPropertymakeCollectionProperty(String name, ModelProperty propertyInfo) protected SimplePropertymakeSimpleProperty(String name, ModelProperty propertyInfo) voidSets an array value.voidsetCollectionProperty(String name, Object[] value) voidsetRetainedProperties(String[] retainedProps) Sets the retained properties.voidsetSimpleProperty(String name, Object value) voidSets a single value.toString()
-
Field Details
-
hierFragment
The hierarchy/main fragment. -
fragments
protected final org.nuxeo.ecm.core.storage.sql.FragmentsMap fragmentsFragment information for each additional mixin or inherited fragment. -
path
Path, only for immediate consumption after construction (will be reset to null afterwards).
-
-
Constructor Details
-
Node
protected Node(PersistenceContext context, org.nuxeo.ecm.core.storage.sql.FragmentGroup fragmentGroup, String path) Creates a Node.- Parameters:
context- the persistence contextfragmentGroup- the group of fragments for the nodepath- the path, if known at construction time
-
-
Method Details
-
getId
Gets the node unique id, usually a Long or a String.- Returns:
- the node id
-
getName
-
getPos
-
getPrimaryType
-
getParentId
-
getPath
Gets the path that was assigned atNodeconstruction time. Then it's reset tonull. Should only be used once.- Returns:
- the path, or
nullfor unknown
-
getHierFragment
-
isVersion
public boolean isVersion() -
isProxy
public boolean isProxy() -
isRecord
public boolean isRecord() -
isFlexibleRecord
public boolean isFlexibleRecord()- Since:
- 2023.1
-
getMixinTypes
Gets the instance mixins. Mixins from the type are not returned.Never returns
null. -
getRetainedProperties
Gets the retained properties.Never returns
null.- Since:
- 2021.32
-
setRetainedProperties
Sets the retained properties.- Parameters:
retainedProps- the retained properties.- Since:
- 2021.32
-
getAllMixinTypes
Gets the mixins. Includes mixins from the type. Returns a fresh set. -
hasMixinType
Checks the mixins. Includes mixins from the type. -
clearCache
protected void clearCache()Clears the properties cache, used when removing mixins. -
getSimpleProperty
Gets a simple property from the node, given its name.- Parameters:
name- the property name- Returns:
- the property
- Throws:
PropertyNotFoundException- if the name is invalid
-
makeSimpleProperty
-
getCollectionProperty
Gets a collection property from the node, given its name.- Parameters:
name- the property name- Returns:
- the property
- Throws:
PropertyNotFoundException- if the name is invalid
-
makeCollectionProperty
-
getPropertyInfo
-
setSimpleProperty
-
setCollectionProperty
-
equals
-
hashCode
public int hashCode() -
toString
-
getSingle
Description copied from interface:StateAccessorGets a single value.- Specified by:
getSinglein interfaceStateAccessor- Parameters:
name- the name- Returns:
- the value
- Throws:
PropertyException
-
getArray
Description copied from interface:StateAccessorGets an array value.- Specified by:
getArrayin interfaceStateAccessor- Parameters:
name- the name- Returns:
- the value
- Throws:
PropertyException
-
setSingle
Description copied from interface:StateAccessorSets a single value.- Specified by:
setSinglein interfaceStateAccessor- Parameters:
name- the namevalue- the value- Throws:
PropertyException
-
setArray
Description copied from interface:StateAccessorSets an array value.- Specified by:
setArrayin interfaceStateAccessor- Parameters:
name- the namevalue- the value- Throws:
PropertyException
-