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 Fragment
s.-
Field Summary
Modifier and TypeFieldDescriptionprotected final org.nuxeo.ecm.core.storage.sql.FragmentsMap
Fragment information for each additional mixin or inherited fragment.protected final SimpleFragment
The hierarchy/main fragment.protected String
Path, only for immediate consumption after construction (will be reset to null afterwards). -
Constructor Summary
ModifierConstructorDescriptionprotected
Node
(PersistenceContext context, org.nuxeo.ecm.core.storage.sql.FragmentGroup fragmentGroup, String path) Creates a Node. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Clears the properties cache, used when removing mixins.boolean
Gets the mixins.Object[]
Gets an array value.getCollectionProperty
(String name) Gets a collection property from the node, given its name.protected SimpleFragment
getId()
Gets the node unique id, usually a Long or a String.String[]
Gets the instance mixins.getName()
getPath()
Gets the path that was assigned atNode
construction time.getPos()
protected ModelProperty
getPropertyInfo
(String name) String[]
Gets the retained properties.getSimpleProperty
(String name) Gets a simple property from the node, given its name.Gets a single value.int
hashCode()
boolean
hasMixinType
(String mixin) Checks the mixins.boolean
boolean
isProxy()
boolean
isRecord()
boolean
protected CollectionProperty
makeCollectionProperty
(String name, ModelProperty propertyInfo) protected SimpleProperty
makeSimpleProperty
(String name, ModelProperty propertyInfo) void
Sets an array value.void
setCollectionProperty
(String name, Object[] value) void
setRetainedProperties
(String[] retainedProps) Sets the retained properties.void
setSimpleProperty
(String name, Object value) void
Sets 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 atNode
construction time. Then it's reset tonull
. Should only be used once.- Returns:
- the path, or
null
for 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:StateAccessor
Gets a single value.- Specified by:
getSingle
in interfaceStateAccessor
- Parameters:
name
- the name- Returns:
- the value
- Throws:
PropertyException
-
getArray
Description copied from interface:StateAccessor
Gets an array value.- Specified by:
getArray
in interfaceStateAccessor
- Parameters:
name
- the name- Returns:
- the value
- Throws:
PropertyException
-
setSingle
Description copied from interface:StateAccessor
Sets a single value.- Specified by:
setSingle
in interfaceStateAccessor
- Parameters:
name
- the namevalue
- the value- Throws:
PropertyException
-
setArray
Description copied from interface:StateAccessor
Sets an array value.- Specified by:
setArray
in interfaceStateAccessor
- Parameters:
name
- the namevalue
- the value- Throws:
PropertyException
-