title: Hibernate Basic: how to query when there is a composite id
body: <p>I have a domain object say, SalesOrder which has a composite id called id, made of salesOrder id and repid which is contained in another class called SalesOrderID(which is serializable and implements equals and hashcode) </p>
  
  <p>my question is when i want to query SalesOrder,
  session.createSQLQuery("FROM SalesOrder where id=:soID")</p>
  
  <p>and soID is populated with salesorder id and repid. this failes no matter what. </p>
  
  <p>can anyone please help me?</p>
  
  <p>thanks</p>