I do have a repo, but I'm trying to avoid using it at this time to learn
how to do things "manually", as it were. Fortunately this isn't code that
needs to see the light of day. :)
So investigating what you said and comparing it what I have, this raises an
interesting question (to me, anyway), and if there's a "best practice" or
definitive answer somewhere, I'd love to see it:
I use Spring to @Autowire "template". "template" is of type
Neo4jOperations, which Neo4jTemplate implements. I'm pretty sure I got
this from some examples online some time ago (mind you, it was for an older
version of SDN).
The question is this: Should I be using Neo4jOperations (which lacks
findUniqueEntity), or should I be using Neo4jTemplate? What's the use case
for each?
On Friday, March 21, 2014 1:20:41 AM UTC-4, Mike Holdsworth wrote:
>
> Not sure how helpful this will be but here goes. When locating by Schema
> Property, use the findBySchemaProperty against the Repo for that entity
> type.
>
> @TypeAlias("AuditHeader")
> public class AuditHeaderNode implements AuditHeader {
> @Indexed
> private String callerKeyRef;
> ......
> }
>
> return auditRepo.findBySchemaPropertyValue("callerKeyRef", keyToFind);
>
> If you don't have a Repo it appears you could call
> template.findUniqueEntity(Class<T>
> entityClass, String propertyName, Object value) which also uses schema
> indexes. I haven't used this yet but it seems to do what you want.
>
> hth.
>
--
You received this message because you are subscribed to the Google Groups
"Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.