Hi all,
I am not sure if someone has asked this kind of question or not, but I just couldn't find the right answer.
The version of Hibernate I am using is Hibernate 2.1 final, and the database is IBM AS/400.
The table I am working on is called Alias, which has a composite primary key with three columns (firm, userid, alias). I created a AliasKey class to hold these three columns, and map it to hbm.xml file using <composite-id>, and everything works just fine. I can load the object using
Code:
AliasKey id = new AliasKey("ab", "cd", ef");
Alias a = session.load(Alias.class, id);
However, now I want to just give firm and userid these two columns to get the records, I don't know how to write the SQL statement to do it, anybody had the same problem before, and knew the solutions?
Thanks so much for your help!