gopal wrote:
I dont know how to map columns if there is no relations ship.
table1 contains clientid, clientname, status,customerid
table 2 contains customerid, customername
i want to display table1 columns, with customer name but there is no relationship in these 2 tables. so how will u map the customer name ???
So, why dont u have the relationship? This looks a perfect way to map both the tables. In your case, how are you maintaining the integrity if you dont have a relationship.
Anyway, if you are working with a legacy db or some such where you cant change, one way to do this would be to write a listener for the "post-load" event like
Code:
<event type="post-load">
<listener class="<something that implements PostLoadListener>"/>
</event>
Your post load listener will use the customerid from table 1 and retrieve the customer name from the other table. This is definitely bad (as it leads to one SQL everytime u load) but if you dont have a relation, this might work.