With DataLoadCoordinator you can get an entity instance from a data container and use it as a parameter like this:
select e from demo_MyEntity e where e.someRef = :container_someOtherEntityDc
If you need a value of some attribute of the entity located in the container, you have to add a ItemChangeEvent listener to the container and set the query parameter programmatically.