I need a little help understanding how to setup the entities and access via HQL.
First lets start with a simple scenario. I have 2 tables associated with Account lets call them AccountOne which is a 1:1 and AccountMany that is 1:M. First I assume I need to set AccountOne as an extension to Account so it is one to one. I assume this because setting relation only gives me 1:M or M:1. Am I correct so far? Next I should go to Account and set a child relation of 1:M to AccountMany - Correct?
Next I am having issue creating a HQL to mimic this SQL query to see if 1 or more records exist to validate a requirement.
select a1.AccountID from AccountOne a1 Inner Join AccountMany a2 on a1.accountid = a2.accountid where a2.somefield <> 'someval'
I tried a simple query to test but get an error (No data type for node: IdentNode Accountid [select Accountid from Accountinginfo where Accountid <> 'A9ESFA0000T1' ].) so I must be missing something here.
I need to understand how to correctly setup the entities and use HQL to query this if someone could be so kind as to give me the nickle tour. |