I stored a data in jsonb column:
@Entity
public class Car {
@Id
private Long id;
@Type(type = "jsonb")
private Data data;
}
Example of structure
{
"id": 1,
"car": "mersedes",
"count": 100,
"stores" : [{
"city": "LA",
"country": "USA",
"brands": [{
"name": "CLS",
"count": 14
},
{
"name": "C-class",
"count": 17
}]
}]
}
a file takes more than 700mB of memory and I don't want to load all the data into RAM, I need to get data only by filters, for example get only CLS model. can this be done with jpa specification?
And if I want to getting only adderesses how to ignore brands? how to get from the original json like this:
{
"stores" : [{
"city": "LA",
"country": "USA"
]}
}