Book Image

EJB 3 Developer Guide

By : Michael Sikora
Book Image

EJB 3 Developer Guide

By: Michael Sikora

Overview of this book

Table of Contents (18 chapters)
EJB 3 Developer Guide
Credits
About the Author
About the Reviewers
Preface
Annotations and Their Corresponding Packages

Collection Comparison Expressions


The IS EMPTY clause tests whether a collection-valued expression has no elements. For example, the query

SELECT c FROM Customer c WHERE c.addresses IS EMPTY

returns only those customers with no addresses.

The MEMBER OF clause tests whether a value of an entity path expression is a member of a collection valued path expression. The query

SELECT DISTINCT c FROM Customer c, Address a
WHERE a MEMBER OF c.addresses

returns only those customers who have addresses.