First, let me say that you should not post twice the same question to the same forum in 5 hour interval.
I am not sure if I fully understand your question. If I get this right, you want to map an Entity to itself through an association.
ie: Collection relatedEntityA = EntityA.getRelatedEntityAs()
If this is the case and if col1 represents your primary key and col2 your foreign key, then you can do it this way.
Code:
set name="relatedEntityAs" table="EntityATable">
<key column="col2"/>
<one-to-many class="EntityA"/>
</set>
if col1 is not your primary key, then it becomes more complex. I would need to read the doc. but it can be done.
But, If what you want is a way to get all records from the EntityA table from an instance of A : like
A.getAllAs(),
then I do not think you should do it through mapping. It should be offered through a DAO.
I hope this will help. Regards,