Question

I have an entity which would be stored in both relational(MySql) and graph database(Neo4j).

@Entity
@NodeEntity(partial = true)
public class User {

    @NotNull
    @Column(name = "UserName", unique = true)
    private String userName;

    @GraphProperty
    String firstName;
}

I know we have JpaRepository and GraphRepository.

public interface UserRepository extends JpaRepository<User, Long> { }

public interface UserGraphRepository extends GraphRepository<User> { }

But is there any repository implementation for handling such a cross store entity? So I could do something like this.

public interface UserRepository extends CrossStoreRepository<User, Long> { }

So when I call save, it should save in both the databases.

I did some searching and found nothing.So started writing one myself.

If no such thing exist, is there a plan to add one in the future?

No correct solution

OTHER TIPS

Is there any reason why you can't use spring-data-neo4j-cross-store as it is part of the spring-data-neo4j distribution?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top