137 lines
6.3 KiB
XML
137 lines
6.3 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
|
|
<section id="reference:programming-model:introduced-methods">
|
|
<title>Introduced methods</title>
|
|
<para>
|
|
The node and relationship aspects introduce (via AspectJ ITD - inter type declaration) several
|
|
methods to the entities.
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term>
|
|
Persisting the node entity after creation and after changes outside of a transaction.
|
|
Participates in an open transaction, or creates its own implicit transaction otherwise.
|
|
</term>
|
|
<listitem>
|
|
<para><code>nodeEntity.persist()</code></para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term>
|
|
Accessing node and relationship IDs
|
|
</term>
|
|
<listitem>
|
|
<para><code>nodeEntity.getNodeId()</code> and <code>relationshipEntity.getRelationshipId()</code></para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term>
|
|
Accessing the node or relationship backing the entity
|
|
</term>
|
|
<listitem>
|
|
<para><code>entity.getPersistentState()</code></para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term>
|
|
equals() and hashCode() are delegated to the underlying state
|
|
</term>
|
|
<listitem>
|
|
<para><code>entity.equals()</code> and <code>entity.hashCode()</code></para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term>
|
|
Creating relationships to a target node entity, and returning the relationship entity instance
|
|
</term>
|
|
<listitem>
|
|
<para><code>nodeEntity.relateTo(targetEntity, relationshipClass, relationshipType)</code></para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term>
|
|
Retrieving a single relationship entity
|
|
</term>
|
|
<listitem>
|
|
<para><code>nodeEntity.getRelationshipTo(targetEntity, relationshipClass, relationshipType)</code></para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term>
|
|
Creating relationships to a target node entity and returning the relationship
|
|
</term>
|
|
<listitem>
|
|
<para><code>nodeEntity.relateTo(targetEntity, relationshipType)</code></para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term>
|
|
Retrieving a single relationship
|
|
</term>
|
|
<listitem>
|
|
<para><code>nodeEntity.getRelationshipTo(targetEnttiy, relationshipType)</code></para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term>
|
|
Removing a single relationship
|
|
</term>
|
|
<listitem>
|
|
<para><code>nodeEntity.removeRelationshipTo(targetEntity, relationshipType)</code></para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term>
|
|
Remove the node entity, its relationships, and all index entries for it
|
|
</term>
|
|
<listitem>
|
|
<para><code>nodeEntity.remove()</code> and <code>relationshipEntity.remove()</code></para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term>
|
|
Project entity to a different target type, using the same backing state
|
|
</term>
|
|
<listitem>
|
|
<para><code>entity.projectTo(targetClass)</code></para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term>
|
|
Traverse, starting from the current node. Returns end nodes of traversal converted to
|
|
the provided type.
|
|
</term>
|
|
<listitem>
|
|
<para><code>nodeEntity.findAllByTraversal(targetType, traversalDescription)</code></para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term>
|
|
Traverse, starting from the current node. Returns <code>EntityPath</code>s of the traversal result
|
|
bound to the provided start and end-node-entity types
|
|
</term>
|
|
<listitem>
|
|
<para><code>Iterable<EntityPath> findAllPathsByTraversal(traversalDescription)</code></para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term>Executes the given query, replacing <code>%start</code> with the node-id and returning the results converted to the target type.</term>
|
|
<listitem>
|
|
<para><code><T> Iterable<T> NodeBacked.findAllByQuery(final String query, final Class<T> targetType)</code></para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term>Executes the given query, replacing <code>%start</code> with the node-id and returning the original result, but with nodes and relationships replaced by their appropriate entities.</term>
|
|
<listitem>
|
|
<para><code>Iterable<Map<String,Object>> NodeBacked.findAllByQuery(final String query)</code></para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term>Executes the given query, replacing <code>%start</code> with the node-id and returns a single result converted to the target type.</term>
|
|
<listitem>
|
|
<para><code><T> T NodeBacked.findByQuery(final String query, final Class<T> targetType)</code></para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</section>
|