<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
    <head> 
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" /> <base href="https://hibernate.atlassian.net" /> 
        <title>Message Title</title> 
    </head> 
    <body class="jira" style="color: #333; font-family: Arial, sans-serif; font-size: 14px; line-height: 1.429"> 
        <table id="background-table" cellpadding="0" cellspacing="0" width="100%" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; background-color: #f5f5f5; border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt"> 
            <!-- header here --> 
            <tr> 
                <td id="header-pattern-container" style="padding: 0px; border-collapse: collapse; padding: 10px 20px"> 
                    <table id="header-pattern" cellspacing="0" cellpadding="0" border="0" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt"> 
                        <tr> 
                            <td id="header-avatar-image-container" valign="top" style="padding: 0px; border-collapse: collapse; vertical-align: top; width: 32px; padding-right: 8px"> <img id="header-avatar-image" class="image_fix" src="https://secure.gravatar.com/avatar/a3fa664923df8007c7bf5402975603ac?d=mm&amp;s=48" height="32" width="32" border="0" style="border-radius: 3px; vertical-align: top" /> 
                            </td> 
                            <td id="header-text-container" valign="middle" style="padding: 0px; border-collapse: collapse; vertical-align: middle; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; mso-line-height-rule: exactly; mso-text-raise: 1px"> <a class="user-hover" rel="Rob Mising Name" id="email_Rob Mising Name" href="https://hibernate.atlassian.net/secure/ViewProfile.jspa?name=Rob+Mising+Name" style="color:#6c797f;; color: #3b73af; text-decoration: none">Rob Mising Name</a> <strong>created</strong> an issue 
                            </td> 
                        </tr> 
                    </table> 
                </td> 
            </tr> 
            <tr> 
                <td id="email-content-container" style="padding: 0px; border-collapse: collapse; padding: 0 20px"> 
                    <table id="email-content-table" cellspacing="0" cellpadding="0" border="0" width="100%" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; border-spacing: 0; border-collapse: separate"> 
                        <tr> 
                            <!-- there needs to be content in the cell for it to render in some clients --> 
                            <td class="email-content-rounded-top mobile-expand" style="padding: 0px; border-collapse: collapse; color: #fff; padding: 0 15px 0 16px; height: 15px; background-color: #fff; border-left: 1px solid #ccc; border-top: 1px solid #ccc; border-right: 1px solid #ccc; border-bottom: 0; border-top-right-radius: 5px; border-top-left-radius: 5px; height: 10px; line-height: 10px; padding: 0 15px 0 16px; mso-line-height-rule: exactly">
                                &nbsp;
                            </td> 
                        </tr> 
                        <tr> 
                            <td class="email-content-main mobile-expand " style="padding: 0px; border-collapse: collapse; border-left: 1px solid #ccc; border-right: 1px solid #ccc; border-top: 0; border-bottom: 0; padding: 0 15px 0 16px; background-color: #fff"> 
                                <table class="page-title-pattern" cellspacing="0" cellpadding="0" border="0" width="100%" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt"> 
                                    <tr> 
                                        <td class="page-title-pattern-first-line " style="padding: 0px; border-collapse: collapse; font-family: Arial, sans-serif; font-size: 14px; padding-top: 10px"> <a href="https://hibernate.atlassian.net/browse/HHH" style="color: #3b73af; text-decoration: none">Hibernate ORM</a> / <a href="https://hibernate.atlassian.net/browse/HHH-9682" style="color: #3b73af; text-decoration: none"><img src="cid:jira-generated-image-static-bug-db6c1013-2b4e-4c4e-a34f-5234589610aa" height="16" width="16" border="0" align="absmiddle" alt="Bug" style="vertical-align: text-bottom" /></a> <a href="https://hibernate.atlassian.net/browse/HHH-9682" style="color: #3b73af; text-decoration: none">HHH-9682</a> 
                                        </td> 
                                    </tr> 
                                    <tr> 
                                        <td style="vertical-align: top;; padding: 0px; border-collapse: collapse; padding-right: 5px; font-size: 20px; line-height: 30px; mso-line-height-rule: exactly" class="page-title-pattern-header-container"> <span class="page-title-pattern-header" style="font-family: Arial, sans-serif; padding: 0; font-size: 20px; line-height: 30px; mso-text-raise: 2px; mso-line-height-rule: exactly; vertical-align: middle"> <a href="https://hibernate.atlassian.net/browse/HHH-9682" style="color: #3b73af; text-decoration: none">HQL Query gives an invalid generated SQL when using joined-subclass</a> </span> 
                                        </td> 
                                    </tr> 
                                </table> 
                            </td> 
                        </tr> 
                        <tr> 
                            <td class="email-content-main mobile-expand  wrapper-special-margin" style="padding: 0px; border-collapse: collapse; border-left: 1px solid #ccc; border-right: 1px solid #ccc; border-top: 0; border-bottom: 0; padding: 0 15px 0 16px; background-color: #fff; padding-top: 10px; padding-bottom: 5px"> 
                                <table class="keyvalue-table" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt"> 
                                    <tr> 
                                        <th style="color: #707070; font: normal 14px/20px Arial, sans-serif; text-align: left; vertical-align: top; padding: 2px 0">
                                            Issue Type:
                                        </th> 
                                        <td class="has-icon" style="padding: 0px; border-collapse: collapse; font: normal 14px/20px Arial, sans-serif; padding: 2px 0 2px 5px; vertical-align: top"> <img src="cid:jira-generated-image-static-bug-db6c1013-2b4e-4c4e-a34f-5234589610aa" height="16" width="16" border="0" align="absmiddle" alt="Bug" style="vertical-align: text-bottom" /> Bug 
                                        </td> 
                                    </tr> 
                                    <tr> 
                                        <th style="color: #707070; font: normal 14px/20px Arial, sans-serif; text-align: left; vertical-align: top; padding: 2px 0">
                                            Affects Versions:
                                        </th> 
                                        <td style="padding: 0px; border-collapse: collapse; font: normal 14px/20px Arial, sans-serif; padding: 2px 0 2px 5px; vertical-align: top">
                                             4.3.8 
                                        </td> 
                                    </tr> 
                                    <tr> 
                                        <th style="color: #707070; font: normal 14px/20px Arial, sans-serif; text-align: left; vertical-align: top; padding: 2px 0">
                                            Assignee:
                                        </th> 
                                        <td style="padding: 0px; border-collapse: collapse; font: normal 14px/20px Arial, sans-serif; padding: 2px 0 2px 5px; vertical-align: top">
                                             Unassigned 
                                        </td> 
                                    </tr> 
                                    <tr> 
                                        <th style="color: #707070; font: normal 14px/20px Arial, sans-serif; text-align: left; vertical-align: top; padding: 2px 0">
                                            Attachments:
                                        </th> 
                                        <td style="padding: 0px; border-collapse: collapse; font: normal 14px/20px Arial, sans-serif; padding: 2px 0 2px 5px; vertical-align: top">
                                             HibernateJoinIssue.zip 
                                        </td> 
                                    </tr> 
                                    <tr> 
                                        <th style="color: #707070; font: normal 14px/20px Arial, sans-serif; text-align: left; vertical-align: top; padding: 2px 0">
                                            Components:
                                        </th> 
                                        <td style="padding: 0px; border-collapse: collapse; font: normal 14px/20px Arial, sans-serif; padding: 2px 0 2px 5px; vertical-align: top">
                                             query-hql 
                                        </td> 
                                    </tr> 
                                    <tr> 
                                        <th style="color: #707070; font: normal 14px/20px Arial, sans-serif; text-align: left; vertical-align: top; padding: 2px 0">
                                            Created:
                                        </th> 
                                        <td style="padding: 0px; border-collapse: collapse; font: normal 14px/20px Arial, sans-serif; padding: 2px 0 2px 5px; vertical-align: top">
                                             25/Mar/2015 04:07 AM 
                                        </td> 
                                    </tr> 
                                    <tr> 
                                        <th style="color: #707070; font: normal 14px/20px Arial, sans-serif; text-align: left; vertical-align: top; padding: 2px 0">
                                            Environment:
                                        </th> 
                                        <td style="padding: 0px; border-collapse: collapse; font: normal 14px/20px Arial, sans-serif; padding: 2px 0 2px 5px; vertical-align: top">
                                             MS-SQL 
                                        </td> 
                                    </tr> 
                                    <tr> 
                                        <th style="color: #707070; font: normal 14px/20px Arial, sans-serif; text-align: left; vertical-align: top; padding: 2px 0">
                                            Priority:
                                        </th> 
                                        <td class="has-icon" style="padding: 0px; border-collapse: collapse; font: normal 14px/20px Arial, sans-serif; padding: 2px 0 2px 5px; vertical-align: top"> <img src="cid:jira-generated-image-static-major-3b031725-87ab-4e5e-99b5-7e9d415ede1c" height="16" width="16" border="0" align="absmiddle" alt="Major" style="vertical-align: text-bottom" /> Major 
                                        </td> 
                                    </tr> 
                                    <tr> 
                                        <th style="color: #707070; font: normal 14px/20px Arial, sans-serif; text-align: left; vertical-align: top; padding: 2px 0">
                                            Reporter:
                                        </th> 
                                        <td style="padding: 0px; border-collapse: collapse; font: normal 14px/20px Arial, sans-serif; padding: 2px 0 2px 5px; vertical-align: top"> <a class="user-hover" rel="Rob Mising Name" id="email_Rob Mising Name" href="https://hibernate.atlassian.net/secure/ViewProfile.jspa?name=Rob+Mising+Name" style="color:#6c797f;; color: #3b73af; text-decoration: none">Rob Mising Name</a> 
                                        </td> 
                                    </tr> 
                                </table> 
                            </td> 
                        </tr> 
                        <tr> 
                            <td class="email-content-main mobile-expand  issue-description-container" style="padding: 0px; border-collapse: collapse; border-left: 1px solid #ccc; border-right: 1px solid #ccc; border-top: 0; border-bottom: 0; padding: 0 15px 0 16px; background-color: #fff; padding-top: 5px; padding-bottom: 10px"> 
                                <table class="text-paragraph-pattern" cellspacing="0" cellpadding="0" border="0" width="100%" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; mso-line-height-rule: exactly; mso-text-raise: 2px"> 
                                    <tr> 
                                        <td class="text-paragraph-pattern-container mobile-resize-text " style="padding: 0px; border-collapse: collapse; padding: 0 0 10px 0"> 
                                            <p style="margin-top:0;margin-bottom:10px;; margin: 10px 0 0 0">I believe I have found a problem with an incorrectly generated query. If I have a database as follows:</p> 
                                            <div class="code panel" style="border-width: 1px;; border: 1px solid #ccc; background: #f5f5f5; font-size: 12px; line-height: 1.333; font-family: monospace; border: 1px solid #ccc; -moz-border-radius: 3px 3px 3px 3px; border-radius: 3px 3px 3px 3px; margin: 9px 0">
                                                <div class="codeContent panelContent" style="padding: 9px 12px"> 
                                                    <pre class="code-java" style="margin: 10px 0 0 0; max-height: 30em; overflow: auto; white-space: pre-wrap; word-wrap: normal">
create table [BDS_2_GDDEMO_VEHICLE] ([BDS_ID] numeric(19,0) not <span class="code-keyword" style="color: #000091">null</span>, [VEHICLEID] nvarchar(400) not <span class="code-keyword" style="color: #000091">null</span> unique, primary key ([BDS_ID]));
create table [BDS_2_GDDEMO_CAR] ([VEHICLE_BDSID] numeric(19,0) not <span class="code-keyword" style="color: #000091">null</span>, [MODEL] nvarchar(400) <span class="code-keyword" style="color: #000091">null</span>, [CAR_CUSTOMER_BDSID] numeric(19,0) <span class="code-keyword" style="color: #000091">null</span>, [CUSTOMER_CARS_IDX] <span class="code-object" style="color: #910091">int</span> <span class="code-keyword" style="color: #000091">null</span>, primary key ([VEHICLE_BDSID]));
create table [BDS_2_GDDEMO_CUSTOMER] ([BDS_ID] numeric(19,0) not <span class="code-keyword" style="color: #000091">null</span>, [NAME] nvarchar(400) <span class="code-keyword" style="color: #000091">null</span>, primary key ([BDS_ID]));
create index IDX_2_GDDEMO_4D7D759B8442F2418 on [BDS_2_GDDEMO_CAR] ([CAR_CUSTOMER_BDSID]);
alter table [BDS_2_GDDEMO_CAR] add constraint FK9503290FABE5971 foreign key ([CAR_CUSTOMER_BDSID]) references [BDS_2_GDDEMO_CUSTOMER];
alter table [BDS_2_GDDEMO_CAR] add constraint FK9503290583BDD8 foreign key ([VEHICLE_BDSID]) references [BDS_2_GDDEMO_VEHICLE];
create index IDX_2_GDDEMO_50956F9F9DD406186 on [BDS_2_GDDEMO_CUSTOMER] ([NAME]);
</pre> 
                                                </div>
                                            </div> 
                                            <p style="margin-top:0;margin-bottom:10px;; margin: 10px 0 0 0">And a hibernate mapping that looks as follows:</p> 
                                            <div class="code panel" style="border-width: 1px;; border: 1px solid #ccc; background: #f5f5f5; font-size: 12px; line-height: 1.333; font-family: monospace; border: 1px solid #ccc; -moz-border-radius: 3px 3px 3px 3px; border-radius: 3px 3px 3px 3px; margin: 9px 0">
                                                <div class="codeContent panelContent" style="padding: 9px 12px"> 
                                                    <pre class="code-java" style="margin: 10px 0 0 0; max-height: 30em; overflow: auto; white-space: pre-wrap; word-wrap: normal">
&lt;?xml version=<span class="code-quote" style="color: #009100">&quot;1.0&quot;</span>?&gt;
&lt;!DOCTYPE hibernate-mapping PUBLIC <span class="code-quote" style="color: #009100">&quot;-<span class="code-comment" style="color: #808080">//Hibernate/Hibernate Mapping DTD 3.0//EN&quot;</span> <span class="code-quote" style="color: #009100">&quot;http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd&quot;</span>&gt;
</span>&lt;hibernate-mapping <span class="code-keyword" style="color: #000091">package</span>=<span class="code-quote" style="color: #009100">&quot;things&quot;</span>&gt;
        &lt;class name=<span class="code-quote" style="color: #009100">&quot;things.Vehicle&quot;</span> entity-name=<span class="code-quote" style="color: #009100">&quot;things.Vehicle&quot;</span> <span class="code-keyword" style="color: #000091">abstract</span>=<span class="code-quote" style="color: #009100">&quot;<span class="code-keyword" style="color: #000091; color: #009100">false</span>&quot;</span> lazy=<span class="code-quote" style="color: #009100">&quot;<span class="code-keyword" style="color: #000091; color: #009100">false</span>&quot;</span> table=<span class="code-quote" style="color: #009100">&quot;BDS_2_GDDEMO_VEHICLE&quot;</span>&gt;
                &lt;id name=<span class="code-quote" style="color: #009100">&quot;bdsId&quot;</span> column=<span class="code-quote" style="color: #009100">&quot;BDS_ID&quot;</span> type=<span class="code-quote" style="color: #009100">&quot;java.lang.<span class="code-object" style="color: #910091; color: #009100">Long</span>&quot;</span>&gt;
                        &lt;generator class=<span class="code-quote" style="color: #009100">&quot;assigned&quot;</span>/&gt;
                &lt;/id&gt;
                &lt;property name=<span class="code-quote" style="color: #009100">&quot;vehicleID&quot;</span> lazy=<span class="code-quote" style="color: #009100">&quot;<span class="code-keyword" style="color: #000091; color: #009100">false</span>&quot;</span> insert=<span class="code-quote" style="color: #009100">&quot;<span class="code-keyword" style="color: #000091; color: #009100">true</span>&quot;</span> update=<span class="code-quote" style="color: #009100">&quot;<span class="code-keyword" style="color: #000091; color: #009100">true</span>&quot;</span> not-<span class="code-keyword" style="color: #000091">null</span>=<span class="code-quote" style="color: #009100">&quot;<span class="code-keyword" style="color: #000091; color: #009100">true</span>&quot;</span> unique=<span class="code-quote" style="color: #009100">&quot;<span class="code-keyword" style="color: #000091; color: #009100">true</span>&quot;</span> type=<span class="code-quote" style="color: #009100">&quot;java.lang.<span class="code-object" style="color: #910091; color: #009100">String</span>&quot;</span>&gt;
                        &lt;column not-<span class="code-keyword" style="color: #000091">null</span>=<span class="code-quote" style="color: #009100">&quot;<span class="code-keyword" style="color: #000091; color: #009100">true</span>&quot;</span> unique=<span class="code-quote" style="color: #009100">&quot;<span class="code-keyword" style="color: #000091; color: #009100">true</span>&quot;</span> name=<span class="code-quote" style="color: #009100">&quot;`VEHICLEID`&quot;</span> length=<span class="code-quote" style="color: #009100">&quot;400&quot;</span>/&gt;
                &lt;/property&gt;
        &lt;/class&gt;
        &lt;joined-subclass name=<span class="code-quote" style="color: #009100">&quot;things.Car&quot;</span> entity-name=<span class="code-quote" style="color: #009100">&quot;things.Car&quot;</span> <span class="code-keyword" style="color: #000091">abstract</span>=<span class="code-quote" style="color: #009100">&quot;<span class="code-keyword" style="color: #000091; color: #009100">false</span>&quot;</span> lazy=<span class="code-quote" style="color: #009100">&quot;<span class="code-keyword" style="color: #000091; color: #009100">false</span>&quot;</span> <span class="code-keyword" style="color: #000091">extends</span>=<span class="code-quote" style="color: #009100">&quot;things.Vehicle&quot;</span> table=<span class="code-quote" style="color: #009100">&quot;`BDS_2_GDDEMO_CAR`&quot;</span>&gt;
                &lt;key&gt;
                        &lt;column name=<span class="code-quote" style="color: #009100">&quot;`VEHICLE_BDSID`&quot;</span>/&gt;
                &lt;/key&gt;
                &lt;property name=<span class="code-quote" style="color: #009100">&quot;model&quot;</span> lazy=<span class="code-quote" style="color: #009100">&quot;<span class="code-keyword" style="color: #000091; color: #009100">false</span>&quot;</span> insert=<span class="code-quote" style="color: #009100">&quot;<span class="code-keyword" style="color: #000091; color: #009100">true</span>&quot;</span> update=<span class="code-quote" style="color: #009100">&quot;<span class="code-keyword" style="color: #000091; color: #009100">true</span>&quot;</span> not-<span class="code-keyword" style="color: #000091">null</span>=<span class="code-quote" style="color: #009100">&quot;<span class="code-keyword" style="color: #000091; color: #009100">false</span>&quot;</span> unique=<span class="code-quote" style="color: #009100">&quot;<span class="code-keyword" style="color: #000091; color: #009100">false</span>&quot;</span> type=<span class="code-quote" style="color: #009100">&quot;java.lang.<span class="code-object" style="color: #910091; color: #009100">String</span>&quot;</span>&gt;
                        &lt;column not-<span class="code-keyword" style="color: #000091">null</span>=<span class="code-quote" style="color: #009100">&quot;<span class="code-keyword" style="color: #000091; color: #009100">false</span>&quot;</span> unique=<span class="code-quote" style="color: #009100">&quot;<span class="code-keyword" style="color: #000091; color: #009100">false</span>&quot;</span> name=<span class="code-quote" style="color: #009100">&quot;`MODEL`&quot;</span> length=<span class="code-quote" style="color: #009100">&quot;400&quot;</span>/&gt;
                &lt;/property&gt;
                 &lt;many-to-one name=<span class="code-quote" style="color: #009100">&quot;customer&quot;</span> entity-name=<span class="code-quote" style="color: #009100">&quot;things.Customer&quot;</span> lazy=<span class="code-quote" style="color: #009100">&quot;<span class="code-keyword" style="color: #000091; color: #009100">false</span>&quot;</span> insert=<span class="code-quote" style="color: #009100">&quot;<span class="code-keyword" style="color: #000091; color: #009100">false</span>&quot;</span> update=<span class="code-quote" style="color: #009100">&quot;<span class="code-keyword" style="color: #000091; color: #009100">false</span>&quot;</span> not-<span class="code-keyword" style="color: #000091">null</span>=<span class="code-quote" style="color: #009100">&quot;<span class="code-keyword" style="color: #000091; color: #009100">false</span>&quot;</span>&gt;
                        &lt;column not-<span class="code-keyword" style="color: #000091">null</span>=<span class="code-quote" style="color: #009100">&quot;<span class="code-keyword" style="color: #000091; color: #009100">false</span>&quot;</span> unique=<span class="code-quote" style="color: #009100">&quot;<span class="code-keyword" style="color: #000091; color: #009100">false</span>&quot;</span> name=<span class="code-quote" style="color: #009100">&quot;`CAR_CUSTOMER_BDSID`&quot;</span> index=<span class="code-quote" style="color: #009100">&quot;IDX_2_GDDEMO_F6B6B2B6980C47196&quot;</span>/&gt;
                &lt;/many-to-one&gt;
        &lt;/joined-subclass&gt;
        &lt;class name=<span class="code-quote" style="color: #009100">&quot;things.Customer&quot;</span> entity-name=<span class="code-quote" style="color: #009100">&quot;things.Customer&quot;</span> <span class="code-keyword" style="color: #000091">abstract</span>=<span class="code-quote" style="color: #009100">&quot;<span class="code-keyword" style="color: #000091; color: #009100">false</span>&quot;</span> lazy=<span class="code-quote" style="color: #009100">&quot;<span class="code-keyword" style="color: #000091; color: #009100">false</span>&quot;</span> table=<span class="code-quote" style="color: #009100">&quot;`BDS_2_GDDEMO_CUSTOMER`&quot;</span>&gt;
                &lt;id name=<span class="code-quote" style="color: #009100">&quot;bdsId&quot;</span> column=<span class="code-quote" style="color: #009100">&quot;BDS_ID&quot;</span> type=<span class="code-quote" style="color: #009100">&quot;java.lang.<span class="code-object" style="color: #910091; color: #009100">Long</span>&quot;</span>&gt;
                        &lt;generator class=<span class="code-quote" style="color: #009100">&quot;assigned&quot;</span>/&gt;
                &lt;/id&gt;
                &lt;property name=<span class="code-quote" style="color: #009100">&quot;name&quot;</span> lazy=<span class="code-quote" style="color: #009100">&quot;<span class="code-keyword" style="color: #000091; color: #009100">false</span>&quot;</span> insert=<span class="code-quote" style="color: #009100">&quot;<span class="code-keyword" style="color: #000091; color: #009100">true</span>&quot;</span> update=<span class="code-quote" style="color: #009100">&quot;<span class="code-keyword" style="color: #000091; color: #009100">true</span>&quot;</span> not-<span class="code-keyword" style="color: #000091">null</span>=<span class="code-quote" style="color: #009100">&quot;<span class="code-keyword" style="color: #000091; color: #009100">false</span>&quot;</span> unique=<span class="code-quote" style="color: #009100">&quot;<span class="code-keyword" style="color: #000091; color: #009100">false</span>&quot;</span> type=<span class="code-quote" style="color: #009100">&quot;java.lang.<span class="code-object" style="color: #910091; color: #009100">String</span>&quot;</span> index=<span class="code-quote" style="color: #009100">&quot;IDX_2_GDDEMO_CC0954156942FC907&quot;</span>&gt;
                        &lt;column not-<span class="code-keyword" style="color: #000091">null</span>=<span class="code-quote" style="color: #009100">&quot;<span class="code-keyword" style="color: #000091; color: #009100">false</span>&quot;</span> unique=<span class="code-quote" style="color: #009100">&quot;<span class="code-keyword" style="color: #000091; color: #009100">false</span>&quot;</span> name=<span class="code-quote" style="color: #009100">&quot;`NAME`&quot;</span> length=<span class="code-quote" style="color: #009100">&quot;400&quot;</span> index=<span class="code-quote" style="color: #009100">&quot;IDX_2_GDDEMO_CC0954156942FC907&quot;</span>/&gt;
                &lt;/property&gt;
                 &lt;list name=<span class="code-quote" style="color: #009100">&quot;cars&quot;</span> lazy=<span class="code-quote" style="color: #009100">&quot;<span class="code-keyword" style="color: #000091; color: #009100">true</span>&quot;</span>&gt;
                        &lt;key update=<span class="code-quote" style="color: #009100">&quot;<span class="code-keyword" style="color: #000091; color: #009100">true</span>&quot;</span>&gt;
                                &lt;column name=<span class="code-quote" style="color: #009100">&quot;`CAR_CUSTOMER_BDSID`&quot;</span> not-<span class="code-keyword" style="color: #000091">null</span>=<span class="code-quote" style="color: #009100">&quot;<span class="code-keyword" style="color: #000091; color: #009100">false</span>&quot;</span> unique=<span class="code-quote" style="color: #009100">&quot;<span class="code-keyword" style="color: #000091; color: #009100">false</span>&quot;</span>/&gt;
                        &lt;/key&gt;
                        &lt;list-index column=<span class="code-quote" style="color: #009100">&quot;`CUSTOMER_CARS_IDX`&quot;</span>/&gt;
                        &lt;one-to-many entity-name=<span class="code-quote" style="color: #009100">&quot;things.Car&quot;</span>/&gt;
                &lt;/list&gt;
        &lt;/class&gt;
&lt;/hibernate-mapping&gt;
</pre> 
                                                </div>
                                            </div> 
                                            <p style="margin-top:0;margin-bottom:10px;; margin: 10px 0 0 0">Then if you try and do the following HQL select</p> 
                                            <div class="code panel" style="border-width: 1px;; border: 1px solid #ccc; background: #f5f5f5; font-size: 12px; line-height: 1.333; font-family: monospace; border: 1px solid #ccc; -moz-border-radius: 3px 3px 3px 3px; border-radius: 3px 3px 3px 3px; margin: 9px 0">
                                                <div class="codeContent panelContent" style="padding: 9px 12px"> 
                                                    <pre class="code-java" style="margin: 10px 0 0 0; max-height: 30em; overflow: auto; white-space: pre-wrap; word-wrap: normal">
SELECT DISTINCT co.bdsId, co.name FROM things.Customer co WHERE EXISTS (FROM co.cars t0 WHERE (t0.vehicleID = :hp0)) ORDER BY co.name, co.bdsId&quot;)
</pre> 
                                                </div>
                                            </div> 
                                            <p style="margin-top:0;margin-bottom:10px;; margin: 10px 0 0 0">You get an error because the SQL that is generated is as follows:</p> 
                                            <div class="code panel" style="border-width: 1px;; border: 1px solid #ccc; background: #f5f5f5; font-size: 12px; line-height: 1.333; font-family: monospace; border: 1px solid #ccc; -moz-border-radius: 3px 3px 3px 3px; border-radius: 3px 3px 3px 3px; margin: 9px 0">
                                                <div class="codeContent panelContent" style="padding: 9px 12px"> 
                                                    <pre class="code-java" style="margin: 10px 0 0 0; max-height: 30em; overflow: auto; white-space: pre-wrap; word-wrap: normal">
select distinct customer0_.BDS_ID as col_0_0_, customer0_.[NAME] as col_1_0_ from [BDS_2_GDDEMO_CUSTOMER] customer0_ where exists (select cars1_.[VEHICLE_BDSID] from [BDS_2_GDDEMO_CAR] cars1_ where customer0_.BDS_ID=cars1_.[CAR_CUSTOMER_BDSID] and cars1_1_.[VEHICLEID]=?) order by customer0_.[NAME], customer0_.BDS_ID
</pre> 
                                                </div>
                                            </div> 
                                            <p style="margin-top:0;margin-bottom:10px;; margin: 10px 0 0 0">The error is:</p> 
                                            <div class="code panel" style="border-width: 1px;; border: 1px solid #ccc; background: #f5f5f5; font-size: 12px; line-height: 1.333; font-family: monospace; border: 1px solid #ccc; -moz-border-radius: 3px 3px 3px 3px; border-radius: 3px 3px 3px 3px; margin: 9px 0">
                                                <div class="codeContent panelContent" style="padding: 9px 12px"> 
                                                    <pre class="code-java" style="margin: 10px 0 0 0; max-height: 30em; overflow: auto; white-space: pre-wrap; word-wrap: normal">
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: The multi-part identifier <span class="code-quote" style="color: #009100">&quot;cars1_1_.VEHICLEID&quot;</span> could not be bound.
</pre> 
                                                </div>
                                            </div> 
                                            <p style="margin-top:0;margin-bottom:10px;; margin: 10px 0 0 0">Highlighting that the SQL that is being generated is using &quot;cars1_1_&quot; without actually setting it.</p> 
                                            <p style="margin-top:0;margin-bottom:10px;; margin: 10px 0 0 0">I have tested this on the latest Hibernate version: 4.3.8 and the problem still exists.</p> 
                                            <p style="margin-top:0;margin-bottom:10px;; margin: 10px 0 0 0">I have created a test case to highlight this and attached it to the report. (I have removed the hibernate libraries from the lib directory in order to keep it's size small)</p> 
                                        </td> 
                                    </tr> 
                                </table> 
                            </td> 
                        </tr> 
                        <tr> 
                            <td class="email-content-main mobile-expand " style="padding: 0px; border-collapse: collapse; border-left: 1px solid #ccc; border-right: 1px solid #ccc; border-top: 0; border-bottom: 0; padding: 0 15px 0 16px; background-color: #fff"> 
                                <table id="actions-pattern" cellspacing="0" cellpadding="0" border="0" width="100%" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; mso-line-height-rule: exactly; mso-text-raise: 1px"> 
                                    <tr> 
                                        <td id="actions-pattern-container" valign="middle" style="padding: 0px; border-collapse: collapse; padding: 10px 0 10px 24px; vertical-align: middle; padding-left: 0"> 
                                            <table align="left" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt"> 
                                                <tr> 
                                                    <td class="actions-pattern-action-icon-container" style="padding: 0px; border-collapse: collapse; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; mso-line-height-rule: exactly; mso-text-raise: 0px; vertical-align: middle"> <a href="https://hibernate.atlassian.net/browse/HHH-9682#add-comment" target="_blank" title="Add Comment" style="color: #3b73af; text-decoration: none"> <img class="actions-pattern-action-icon-image" src="cid:jira-generated-image-static-comment-icon-ae7568d7-93e5-46f6-b3d2-1c86a2b70f3d" alt="Add Comment" title="Add Comment" height="16" width="16" border="0" style="vertical-align: middle" /> </a> 
                                                    </td> 
                                                    <td class="actions-pattern-action-text-container" style="padding: 0px; border-collapse: collapse; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; mso-line-height-rule: exactly; mso-text-raise: 4px; padding-left: 5px"> <a href="https://hibernate.atlassian.net/browse/HHH-9682#add-comment" target="_blank" title="Add Comment" style="color: #3b73af; text-decoration: none">Add Comment</a> 
                                                    </td> 
                                                </tr> 
                                            </table> 
                                        </td> 
                                    </tr> 
                                </table> 
                            </td> 
                        </tr> 
                        <!-- there needs to be content in the cell for it to render in some clients --> 
                        <tr> 
                            <td class="email-content-rounded-bottom mobile-expand" style="padding: 0px; border-collapse: collapse; color: #fff; padding: 0 15px 0 16px; height: 5px; line-height: 5px; background-color: #fff; border-top: 0; border-left: 1px solid #ccc; border-bottom: 1px solid #ccc; border-right: 1px solid #ccc; border-bottom-right-radius: 5px; border-bottom-left-radius: 5px; mso-line-height-rule: exactly">
                                &nbsp;
                            </td> 
                        </tr> 
                    </table> 
                </td> 
            </tr> 
            <tr> 
                <td id="footer-pattern" style="padding: 0px; border-collapse: collapse; padding: 12px 20px"> 
                    <table id="footer-pattern-container" cellspacing="0" cellpadding="0" border="0" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt"> 
                        <tr> 
                            <td id="footer-pattern-text" class="mobile-resize-text" width="100%" style="padding: 0px; border-collapse: collapse; color: #999; font-size: 12px; line-height: 18px; font-family: Arial, sans-serif; mso-line-height-rule: exactly; mso-text-raise: 2px">
                                 This message was sent by Atlassian JIRA <span id="footer-build-information">(v6.4-OD-16-005#64014-<span title="3f74600eafc6d9ee6cd982fee01d8a5a071242fd" data-commit-id="3f74600eafc6d9ee6cd982fee01d8a5a071242fd}">sha1:3f74600</span>)</span> 
                            </td> 
                            <td id="footer-pattern-logo-desktop-container" valign="top" style="padding: 0px; border-collapse: collapse; padding-left: 20px; vertical-align: top"> 
                                <table style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt"> 
                                    <tr> 
                                        <td id="footer-pattern-logo-desktop-padding" style="padding: 0px; border-collapse: collapse; padding-top: 3px"> <img id="footer-pattern-logo-desktop" src="cid:jira-generated-image-static-footer-desktop-logo-35f6186b-0e19-4c73-beae-0b7b7b832782" alt="Atlassian logo" title="Atlassian logo" width="169" height="36" class="image_fix" /> 
                                        </td> 
                                    </tr> 
                                </table> 
                            </td> 
                        </tr> 
                    </table> 
                </td> 
            </tr> 
        </table>   
    </body>
</html>