0

please can someone help convert this sql query to an Hql query. Or can the query run as Hql?

select p.passport_data, b.unique_number, d.da38 as category
from passport p, dynamic_data d, basic_data b
where b.id = d.basic_data_fk
and p.basic_data_fk = b.id and d.da38 = 'SUBEB'

they entity classes are: Passport, BasicData, DynamicData

Passport entity class has fields/variables- passportData, basicData
BasicData entity class has fields/variables- id, uniqueNumber
DynamicData entity class has fields/variables- da38
1
  • 1
    You have to show us, how tables passport, dynamic_data and basic_data are mapped to hibernate entities. Commented Sep 21, 2016 at 17:17

1 Answer 1

1

Try this:

select p.passport_data, b.unique_number, d.da38 as category
from Passport p, DynamicData d, BasicData b
where b.id = d.basicData
and p.basicData = b.id and d.da38 = 'SUBEB'

I suppose in your DynamicData exists a field named basicData (as in Passport class)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.