Hey folks,

Does anyone know of a simple way of getting Spring Data Neo4j to create 
indexes for a class without instantiating a repository?

I'm using Neo4jTemplate to interact with the database, with a class like 
this:

    @NodeEntity
    class ABaseBLPU {
        @GraphId Long i
        @Indexed(unique = true) long uprn
        long uprn
    }

but the index isn't being created. I imagine that that would happen if I 
was using a repository class:

    interface MyGraph extends GraphRepository<ABaseBLPU> {}

However, I've got loads of classes, and I don't really want to instantiate 
graph repos for them all, as I'm not going to use the repo.

So, do the indexes get created if I were to do:

     def graph = neo4jTemplate.repositoryFor(ABaseBLPU.class)

Or, is there a way to wire up the spring configuration so that the indexes 
for the domain classes get created at startup time, but without having to 
define all the repos?

Thanks,
Joe

-- 
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.

Reply via email to