Your observation is correct here.
Mendix OQL will give new instance of objects only. OQL will not give you same Mendix object.
This can be done through xpath.
If the query is dynamically generated, you might need to create a java action which executes the dynamic xpath.
You can create a filter helper and make an association from table to filterhelper and the OQL is
select *
from table T
inner join T/domain.table_filterhelper/domain.filterhelper FH
where FH = $Parameter
As an alternative you can create the OQL as a string and call the OQL functions from the OQL module passing a non persistable entity with the required/identical attributes.