I\'m new with Hibernate and Criteria Query. So I have implemented the query in HQL:
select A.mobilephone
B.userNick
C.creditCard
from mobile_table A
Your example is just a native SQL , not the HQL . Anyway , you can use the following methods from the Criteria API to construct the desired Criteria object :
For example , if the SQL is :
select
TableA.columnA ,TableB.columnB ,TableC.columnC
from TableA
inner join TableB on TableA.tableB_id=TableB.id
inner join TableC on TableA.tableC_id=TableC.id
where TableA.columnAA="AAA"
and TableB.columnBB="BBB"
and TableC.columnCC="CCC"
Then the Criteria object will be:
List
Please note that all parameters in the Criteria use the property name and class name in the mapped Java entities.