Announcement Announcement Module
Collapse
No announcement yet.
Neo4J: Using spatial-Index in standalone mode Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Neo4J: Using spatial-Index in standalone mode

    Hi,

    i am using Spring Data Neo4J in standalone mode, so i cannot use "@Autowired". I want to use spatial abilities of the repository but don't know, how to do that.

    Code:
    public interface OsmAddressRepo extends GraphRepository<OsmAddress>, SpatialRepository<OsmAddress> {
    }
    Of course, i can't create an object of type OsmAddressRepo

    Code:
    GraphRepository<OsmAddress> addressRepo = this.neoTemplate.repositoryFor(OsmAddress.class);
    neoTemplate doesn't return my defined "interface OsmAddressRepo", of course (and not supringsingly). Casting doesn't help, too.

    Is there a way to inform neoTemplat manually about my defined interface? Or is there a way to cast the return of neoTemplate?

    Greetz,
    Markus

    Using: Spring Data Neo4j 2.1.0RC3, neo4j 1.8M07, neo4j-spatial 0.9SNAPSHOT;
    http://static.springsource.org/sprin...erence:spatial

  • #2
    Markus,

    You should be able to use http://static.springsource.org/sprin...onContext.html , getBean(...) to get a proper wired up repository. I haven't got an example to hand, but have done something similar before.

    Regards,

    Lasse

    Comment

    Working...
    X