admin管理员组

文章数量:1122846

Suppose I have entities:

@Entity
class User {
   id
   name
   List<Address> addresses;
}

and

@Entity
class Address {
   id
   street
}

I need to do search based on user.name and address.stree I have entity view like:

@EntityView(User.class) 
interface UserView {
   Long getId()
   String getName()
   List<AdressView> getAdresses()
    
    interface AddressView { ... }
}

I am using CriteriaBuilder for searching with implicit joins like:

criteriaBuilder.where("name").eq(name)
            

and

criteriaBuilder.whereExists() for adresses.

But what feature of blaze persistence framework should I use to correctly search for related addresses and to have all the adresses related to the user being returned in the UserView.getAddresses() ?

本文标签: hibernateblaze persistence complex searchsuggested approachStack Overflow