'Spring Data JPA: how to make one to one relationship with SQL Server JSON column

Spring Data JPA: how to make one to one relationship with SQL Server JSON column?

Class EntityA {
  long id;
  @Type(type = "json")
  @Column(columnDefinition = "json")
  private String jsonField; 

}

Class EntityTypeA {
 long id;
 long key;
 List result; 
}

Json filed:

{ 
  TypeA: {
    id:1, 
    result: []
  }, 
  TypeB: {
    id:1, 
    key:2, 
    result:[], 
    input: '1,2,3', 
    output:null
  }
}

How to combine and get the result of Entity A and TypeA using the id field in JSON property?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source