Adjusted CDATA to remove leading blank line. Ensured that all <programlisting>s are in <example>s.
This commit is contained in:
@@ -11,8 +11,7 @@
|
||||
</para>
|
||||
<example>
|
||||
<title>Bean validation</title>
|
||||
<programlisting language="java"><![CDATA[
|
||||
@NodeEntity
|
||||
<programlisting language="java"><![CDATA[@NodeEntity
|
||||
class Person {
|
||||
@Size(min = 3, max = 20)
|
||||
String name;
|
||||
|
||||
@@ -39,8 +39,7 @@
|
||||
</para>
|
||||
<example>
|
||||
<title>Indexing entities</title>
|
||||
<programlisting language="java"><![CDATA[
|
||||
@NodeEntity
|
||||
<programlisting language="java"><![CDATA[@NodeEntity
|
||||
class Person {
|
||||
@Indexed(indexName = "people") String name;
|
||||
@Indexed int age;
|
||||
@@ -80,8 +79,7 @@ for (Person middleAgedDeveloper : graphRepository.findAllByRange("age", 20, 40))
|
||||
<para>
|
||||
<example>
|
||||
<title>Fulltext indexing</title>
|
||||
<programlisting language="java"><![CDATA[
|
||||
@NodeEntity
|
||||
<programlisting language="java"><![CDATA[@NodeEntity
|
||||
class Person {
|
||||
@Indexed(indexName = "person-name", fulltext=true) String name;
|
||||
}
|
||||
@@ -111,8 +109,7 @@ Person mark = graphRepository.findAllByQuery("people-search", "name", "ma*");
|
||||
</para>
|
||||
<example>
|
||||
<title>Manual index usage</title>
|
||||
<programlisting language="java"><![CDATA[
|
||||
@Autowired GraphDatabaseContext gdc;
|
||||
<programlisting language="java"><![CDATA[@Autowired GraphDatabaseContext gdc;
|
||||
|
||||
// Default index
|
||||
Index<Node> personIndex = gdc.getIndex(Person.class);
|
||||
|
||||
@@ -24,9 +24,9 @@
|
||||
reporting or auditing) and only project them to a concrete, more functional target type when the business
|
||||
logic requires it.
|
||||
</para>
|
||||
<programlisting language="java"><![CDATA[
|
||||
// not related to Person at all
|
||||
@NodeEntity
|
||||
<example>
|
||||
<title>Projection of entities</title>
|
||||
<programlisting language="java"><![CDATA[@NodeEntity
|
||||
class Trainee {
|
||||
String name;
|
||||
@RelatedTo(elementClass=Training.class);
|
||||
@@ -40,5 +40,7 @@ for (Person person : graphRepository.findAllByProperyValue("occupation","develop
|
||||
}
|
||||
}
|
||||
]]></programlisting>
|
||||
</example>
|
||||
|
||||
|
||||
</section>
|
||||
|
||||
@@ -24,8 +24,7 @@
|
||||
|
||||
<example>
|
||||
<title>Single relationship field</title>
|
||||
<programlisting language="java"><![CDATA[
|
||||
@NodeEntity
|
||||
<programlisting language="java"><![CDATA[@NodeEntity
|
||||
public class Movie {
|
||||
private Actor mostPaidActor;
|
||||
}
|
||||
@@ -42,8 +41,7 @@ public class Movie {
|
||||
</para>
|
||||
<example>
|
||||
<title>Node entity with relationships</title>
|
||||
<programlisting language="java"><![CDATA[
|
||||
@NodeEntity
|
||||
<programlisting language="java"><![CDATA[@NodeEntity
|
||||
public class Actor {
|
||||
@RelatedTo(type = "mostPaidActor", direction = Direction.INCOMING,
|
||||
elementClass = Movie.class)
|
||||
@@ -103,8 +101,7 @@ public class Actor {
|
||||
</para>
|
||||
<example>
|
||||
<title>Relationship entity</title>
|
||||
<programlisting language="java"><![CDATA[
|
||||
@NodeEntity
|
||||
<programlisting language="java"><![CDATA[@NodeEntity
|
||||
public class Actor {
|
||||
public Role playedIn(Movie movie, String title) {
|
||||
return relatedTo(movie, Role.class, "ACTS_IN");
|
||||
@@ -132,8 +129,7 @@ public class Role {
|
||||
</para>
|
||||
<example>
|
||||
<title>Accessing relationship entities using @RelatedToVia</title>
|
||||
<programlisting language="java"><![CDATA[
|
||||
@NodeEntity
|
||||
<programlisting language="java"><![CDATA[@NodeEntity
|
||||
public class Actor {
|
||||
@RelatedToVia(type = "ACTS_IN", elementClass = Role.class)
|
||||
private Iterable<Role> roles;
|
||||
|
||||
@@ -132,28 +132,27 @@
|
||||
</para>
|
||||
<example>
|
||||
<title>Using GraphRepositories</title>
|
||||
<programlisting language="java"><![CDATA[
|
||||
GraphRepository<Person> graphRepository = graphRepositoryFactory
|
||||
.createGraphRepository(Person.class);
|
||||
<programlisting language="java"><![CDATA[GraphRepository<Person> graphRepository = graphRepositoryFactory
|
||||
.createGraphRepository(Person.class);
|
||||
|
||||
Person michael = graphRepository.save(new Person("Michael", 36));
|
||||
Person michael = graphRepository.save(new Person("Michael", 36));
|
||||
|
||||
Person dave = graphRepository.findOne(123);
|
||||
Person dave = graphRepository.findOne(123);
|
||||
|
||||
Long numberOfPeople = graphRepository.count();
|
||||
Long numberOfPeople = graphRepository.count();
|
||||
|
||||
Person mark = graphRepository.findByPropertyValue("name", "mark");
|
||||
Person mark = graphRepository.findByPropertyValue("name", "mark");
|
||||
|
||||
Iterable<Person> devs = graphRepository.findAllByProperyValue("occupation", "developer");
|
||||
Iterable<Person> devs = graphRepository.findAllByProperyValue("occupation", "developer");
|
||||
|
||||
Iterable<Person> middleAgedPeople = graphRepository.findAllByRange("age", 20, 40);
|
||||
Iterable<Person> middleAgedPeople = graphRepository.findAllByRange("age", 20, 40);
|
||||
|
||||
Iterable<Person> aTeam = graphRepository.findAllByQuery("name", "A*");
|
||||
Iterable<Person> aTeam = graphRepository.findAllByQuery("name", "A*");
|
||||
|
||||
Iterable<Person> davesFriends = graphRepository.findAllByTraversal(dave,
|
||||
Traversal.description().pruneAfterDepth(1)
|
||||
.relationships(KNOWS).filter(returnAllButStartNode()));
|
||||
]]></programlisting>
|
||||
Iterable<Person> davesFriends = graphRepository.findAllByTraversal(dave,
|
||||
Traversal.description().pruneAfterDepth(1)
|
||||
.relationships(KNOWS).filter(returnAllButStartNode()));
|
||||
]]></programlisting>
|
||||
</example>
|
||||
</section>
|
||||
|
||||
@@ -167,8 +166,7 @@
|
||||
</para>
|
||||
<example>
|
||||
<title>Composing repositories</title>
|
||||
<programlisting language="java"><![CDATA[
|
||||
public interface PersonRepository extends GraphRepository<Person>, PersonRepositoryExtension {}
|
||||
<programlisting language="java"><![CDATA[public interface PersonRepository extends GraphRepository<Person>, PersonRepositoryExtension {}
|
||||
|
||||
// alternatively select some of the required repositories individually
|
||||
public interface PersonRepository extends CRUDGraphRepository<Node,Person>,
|
||||
|
||||
@@ -22,8 +22,7 @@
|
||||
</note>
|
||||
<example>
|
||||
<title>Simple transaction manager configuration</title>
|
||||
<programlisting language="xml"><![CDATA[
|
||||
<bean id="transactionManager" class="org.springframework.transaction.jta.JtaTransactionManager">
|
||||
<programlisting language="xml"><![CDATA[<bean id="transactionManager" class="org.springframework.transaction.jta.JtaTransactionManager">
|
||||
<property name="transactionManager">
|
||||
<bean class="org.neo4j.kernel.impl.transaction.SpringTransactionManager">
|
||||
<constructor-arg ref="graphDatabaseService"/>
|
||||
@@ -47,8 +46,7 @@
|
||||
</para>
|
||||
<example>
|
||||
<title>Neo4j Spring integration</title>
|
||||
<programlisting language="xml"><![CDATA[
|
||||
<context:annotation-config />
|
||||
<programlisting language="xml"><![CDATA[<context:annotation-config />
|
||||
<context:spring-configured/>
|
||||
|
||||
<bean id="transactionManager" class="org.springframework.transaction.jta.JtaTransactionManager">
|
||||
@@ -78,8 +76,7 @@
|
||||
</para>
|
||||
<example>
|
||||
<title>ChainedTransactionManager example</title>
|
||||
<programlisting language="xml"><![CDATA[
|
||||
<bean id="jpaTransactionManager"
|
||||
<programlisting language="xml"><![CDATA[<bean id="jpaTransactionManager"
|
||||
class="org.springframework.orm.jpa.JpaTransactionManager">
|
||||
<property name="entityManagerFactory" ref="entityManagerFactory"/>
|
||||
</bean>
|
||||
|
||||
Reference in New Issue
Block a user