Files
spring-data-neo4j/src/docbkx/reference/programming-model/introducedmethods.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&lt;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>&lt;T&gt; Iterable&lt;T&gt; NodeBacked.findAllByQuery(final String query, final Class&lt;T&gt; 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&lt;Map&lt;String,Object&gt;&gt; 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>&lt;T&gt; T NodeBacked.findByQuery(final String query, final Class&lt;T&gt; targetType)</code></para>
</listitem>
</varlistentry>
</variablelist>
</para>
</section>