I would like to avoid "No row with the given identifier exists:" exception.
I have two tables . MainTransaction and SubTransaction
MainTransaction Table has four fields
1.Transaction ID (Primary Key)
2.BranchID
3.BranchName
4.BranchAddress
BranchID and BranchName are foreinkey to link to SubTransaction Table..
SubTransaction Table has five fields
1.BranchID
2.BranchName
3.Location
4.Activity
BranchID and BranchName are composite id to link to MainTransaction Table.
Here are the
Java Class Declarations....
__________________________________________________________________________________--
____________________________________________________________________________________________________
Here is relationship in the mapping file (MainTransaction.hbm.xml).. Mapping is okay. The problem is that I get the exception(No row with the given identifier exists:)
When I execute the "mainTransaction.getSubTran" getter method with no related record in subTransaction table. I do not want the exeception. I just want to check whether null or not and want to continue the program execution..
Here is codes that raise the exception
Please tell me if you have any idea......
With Regards......