adamzrk
adamzrk

Reputation: 1

blaze persistence complex search - suggested approach

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() ?

Upvotes: 0

Views: 13

Answers (0)

Related Questions