public Predicate connect ( List < Predicate > predicates , Connective connective ) { Predicate [ ] predicateArray = predicates . toArray ( new Predicate [ predicates . size ( ) ] ) ; switch ( connective ) { case AND : return cb . and ( predicateArray ) ; case OR : return cb . or ( predicateArray ) ; default : throw new UnsupportedOperationException ( "Unknown connective " + connective ) ; } }
Joins the given predicates using the criteria builder with the given connective .