public List getProductCodeInfo(Session session){ String sql = "select p.product_id, p.description, p.product_code, pc.description, pc.discount_code from product p, product_code pc where p.product_code = pc.prod_code"; return session.createSQLQuery(sql).list(); }
This simple join SQL query returned wrong results for column pc.description( it returns the same values as those for p.description) and only the first character for p.product_code which is of type CHAR, length 2.
How to ensure proper results?
Thank you Uma
|