Section 6.2 of the documentation states:
"Composite element properties may not appear in a query, unfortunately."
The following post from Gavin suggests that this is "probably not very difficult".
I would really be like to do the following:
int count = ((Integer) session.filter(myCompositeElementsColection, "select count where myProperty = ?", somePropertyValue, Hibernate.entity(SomePropertyType.class)).iterator().next()).intValue();