I have been tiring to use the criteria to filter a query with an object.
Is this possible?
When I execute the query it brings back all Eventattendance not just the one
I'm query for.
When I query on some other field a String or Int the query works as I would expect.
I'm not sure what your object model looks like, so this may or may not be relevant ;-)
It sounds as if you have an association within your Eventattendance class represented by another object and you want to query your results and restrict by some attribute in the associated class.
I've added an example below which hopefully is similar to your model. I have a User class {name, age, Address} and an Address class {house number, city, postcode} and the criteria query that I've added will find all Users that have User.name beginning with 'B' and User.Address.postcode beginning 'SE19' (both non-case sensitive)
Basically, you end up creating a criteria on User for the associated class (in this case Address) and then adding a Restriction on that Criteria to limit your Addresses to those that begin with the right postcode.