Does
DocumentAttributesets contains any other columns ?
If this table is a simple link table, used to represent many-to-many relationship, than it is better to use this kind of relationship mapping in xml files for Documnt and Attribute tables.
In this case you will be able to search for document by attributes like
Code:
from Document doc where doc.attributes.elements = :attribute
where :attribute parameter value is the instance of Attribute object loaded before quering.
I think you plugin for Eclipse simlpy wrongly named the class Documnts instead of 'Document', since it is not a collection but an object in composit key.