Package org.nuxeo.ecm.core.storage.sql
Class Node
- java.lang.Object
-
- org.nuxeo.ecm.core.storage.sql.Node
-
- All Implemented Interfaces:
StateAccessor
public class Node extends Object implements StateAccessor
ANodeimplementation. The actual data is stored in contained objects that areFragments.
-
-
Field Summary
Fields Modifier and Type Field Description protected org.nuxeo.ecm.core.storage.sql.FragmentsMapfragmentsFragment information for each additional mixin or inherited fragment.protected SimpleFragmenthierFragmentThe hierarchy/main fragment.protected StringpathPath, only for immediate consumption after construction (will be reset to null afterwards).
-
Constructor Summary
Constructors Modifier Constructor Description protectedNode(PersistenceContext context, org.nuxeo.ecm.core.storage.sql.FragmentGroup fragmentGroup, String path)Creates a Node.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidclearCache()Clears the properties cache, used when removing mixins.booleanequals(Object other)Set<String>getAllMixinTypes()Gets the mixins.Object[]getArray(String name)Gets an array value.CollectionPropertygetCollectionProperty(String name)Gets a collection property from the node, given its name.protected SimpleFragmentgetHierFragment()SerializablegetId()Gets the node unique id, usually a Long or a String.String[]getMixinTypes()Gets the instance mixins.StringgetName()SerializablegetParentId()StringgetPath()Gets the path that was assigned atNodeconstruction time.LonggetPos()StringgetPrimaryType()protected ModelPropertygetPropertyInfo(String name)String[]getRetainedProperties()Gets the retained properties.SimplePropertygetSimpleProperty(String name)Gets a simple property from the node, given its name.ObjectgetSingle(String name)Gets a single value.inthashCode()booleanhasMixinType(String mixin)Checks the mixins.booleanisFlexibleRecord()booleanisProxy()booleanisRecord()booleanisVersion()protected CollectionPropertymakeCollectionProperty(String name, ModelProperty propertyInfo)protected SimplePropertymakeSimpleProperty(String name, ModelProperty propertyInfo)voidsetArray(String name, Object[] value)Sets an array value.voidsetCollectionProperty(String name, Object[] value)voidsetRetainedProperties(String[] retainedProps)Sets the retained properties.voidsetSimpleProperty(String name, Object value)voidsetSingle(String name, Object value)Sets a single value.StringtoString()
-
-
-
Field Detail
-
hierFragment
protected final SimpleFragment hierFragment
The hierarchy/main fragment.
-
fragments
protected final org.nuxeo.ecm.core.storage.sql.FragmentsMap fragments
Fragment information for each additional mixin or inherited fragment.
-
path
protected String path
Path, only for immediate consumption after construction (will be reset to null afterwards).
-
-
Constructor Detail
-
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 Detail
-
getId
public Serializable getId()
Gets the node unique id, usually a Long or a String.- Returns:
- the node id
-
getName
public String getName()
-
getPos
public Long getPos()
-
getPrimaryType
public String getPrimaryType()
-
getParentId
public Serializable getParentId()
-
getPath
public String 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
protected SimpleFragment getHierFragment()
-
isVersion
public boolean isVersion()
-
isProxy
public boolean isProxy()
-
isRecord
public boolean isRecord()
-
isFlexibleRecord
public boolean isFlexibleRecord()
- Since:
- 2023.1
-
getMixinTypes
public String[] getMixinTypes()
Gets the instance mixins. Mixins from the type are not returned.Never returns
null.
-
getRetainedProperties
public String[] getRetainedProperties()
Gets the retained properties.Never returns
null.- Since:
- 2021.32
-
setRetainedProperties
public void setRetainedProperties(String[] retainedProps)
Sets the retained properties.- Parameters:
retainedProps- the retained properties.- Since:
- 2021.32
-
getAllMixinTypes
public Set<String> getAllMixinTypes()
Gets the mixins. Includes mixins from the type. Returns a fresh set.
-
hasMixinType
public boolean hasMixinType(String mixin)
Checks the mixins. Includes mixins from the type.
-
clearCache
protected void clearCache()
Clears the properties cache, used when removing mixins.
-
getSimpleProperty
public SimpleProperty getSimpleProperty(String name)
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
protected SimpleProperty makeSimpleProperty(String name, ModelProperty propertyInfo)
-
getCollectionProperty
public CollectionProperty getCollectionProperty(String name)
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
protected CollectionProperty makeCollectionProperty(String name, ModelProperty propertyInfo)
-
getPropertyInfo
protected ModelProperty getPropertyInfo(String name)
-
getSingle
public Object getSingle(String name) throws PropertyException
Description copied from interface:StateAccessorGets a single value.- Specified by:
getSinglein interfaceStateAccessor- Parameters:
name- the name- Returns:
- the value
- Throws:
PropertyException
-
getArray
public Object[] getArray(String name) throws PropertyException
Description copied from interface:StateAccessorGets an array value.- Specified by:
getArrayin interfaceStateAccessor- Parameters:
name- the name- Returns:
- the value
- Throws:
PropertyException
-
setSingle
public void setSingle(String name, Object value) throws PropertyException
Description copied from interface:StateAccessorSets a single value.- Specified by:
setSinglein interfaceStateAccessor- Parameters:
name- the namevalue- the value- Throws:
PropertyException
-
setArray
public void setArray(String name, Object[] value) throws PropertyException
Description copied from interface:StateAccessorSets an array value.- Specified by:
setArrayin interfaceStateAccessor- Parameters:
name- the namevalue- the value- Throws:
PropertyException
-
-