java - Hibernate HQL strange behavior with IS NULL -
I want to get the problem with a HQL query I all PID do that 'M' or an administrative Sex There is an administrative sex set for Java (the value in Java is set to zero).
PID.class
@ Antiti @ Table (name = "Patient Identification") public class PID {@OneToOne (cascade = CascadeType.ALL) @JoinColumn (name = "Administrative SX", referenced columnname = "is_id") personal IS administrative SX; ...} GenerationType.AUTO) @column (name = "is_id") private integer ID; Private string value; ...}
HQL query
PID where administrativeSex empty or administrative Sakskvlu = 'M'
produced SQL
pid0_.pid_id the pid1_84_, pid0_.administrativeSex as adminis11_84_, pid0_.birthOrder birthOrder84_, pid0_.birth Place as birthPlace84_, pid0_ citizen as citizenship 12_84_, pid0_.countyCode, as pid0_.datTimeOfBirth, driverL22_84_ as pid0_.driverLicenseNumber, maritalS8_84_, multiple4_84_pid0_.multipleBirthIndicator, nationa17_84_ as pid0_.nationality as pid0_.maritalStatus, pid0_.patientAccountNumber patientA6_84_, patient16_84_ form, as pid0_.countyCode countyCode84_, dateTim19_84_ Pid0_.patientDea ThDateAndTime form owner9_84_pid0_.owner_id, Pid0_.patientDeathIndicator as patient18_84_, pid0_.patientId as patientId84_, pid0_.primary as primary language_7_84_, pid0_.race race84_, pid0_.religion as religion_84_, pid0_.setId setId84_, pid0_.ssnNumber As ssnNumber84_, pi D0_.veteransMilitaryStatus as Veterans2_84_ as the brain identification pid0_, CodedValueForUserDefinedTables is1_ where pid0_.administrativeSex = is1_.is_id and (pid0_.sministrativeSex is zero or is1_.value = 'M')
The query is only return PID, which is set on the administrative sex 'M', it is missing in it which is not administrative gender. If you look at SQL queries, then this is normal. How can I fix my HQL query?
Hibernate reference guide:
Two join Ackyuel Association Supports forms: Built-in and clear.
All use the clear form in the questions shown in the previous section, i.e., where the included keyword is clearly used in the clause. This is a recommended form.
Does not use keywords included in the underlying form. Instead, the associations have been "dereferenced" using dot-notation. Inherent included in any HQL sections may appear. The resulting SQL statement gives inherent results in interlinking.
Since these attachments do not match, one of those internal lines contains the intern, you do not remember the people of the unknown gender. If you want a left external insertion, which do you request: PID PID contains
left external pin. Leave the administrative sex as sex where pid.administrativeSex is zero or gender. Value = 'm'
Comments
Post a Comment