You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
And this is some service where i'm trying to filter on the subentity
var username = "bob"
/*
Gets the main entities (I would like the filter for the ManyToOne entity here)
*/
var entities = jpaStreamer.stream(of(MainEntity.class).joining(MainEntity$.subEntity))
.filter(MainEntity$.username.equal(username))
//.filter(MainEntity$.subEntity.state.notEqual("DONE")) <-Doesnt work..
.toList();
/*
Have to do it like this. Filter the main entities from the subEntity..
This results in slower performance because it's no longer part of the SQL query
*/
var filteredEntities = new ArrayList<MainEntity>();
entities.forEach(entity -> {
if(!(entity.getSubEntity().getState().equals("DONE"))){
filteredEntities.add(entity);
}
});
Is this possible in JpaStreamer? I know it's possible in Entity Framework and LINQ from C# ;)
The text was updated successfully, but these errors were encountered:
Hi
I've not found any example on how to filter a entity based on some value inside a sub entity.
Assume this is my MainEntity
And this is some service where i'm trying to filter on the subentity
Is this possible in JpaStreamer? I know it's possible in Entity Framework and LINQ from C# ;)
The text was updated successfully, but these errors were encountered: