문제

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?

올바른 솔루션이 없습니다

다른 팁

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top