Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version: 3.0.5
Here's a simple Where clause:
where form.appl_Id = application.appl_Id
and application.appl_Id *= APPL_THEMES.appl_Id
Because of an association mapping between APPL_THEMES and CODE tables, when a query is executed with that where clause, the SQL generated will look like this:
where form.applId = application.applId
and application.applId *= APPL_THEMES.applId
and APPL_THEMES.theme_code = Code.code
Now, this is not an acceptable SQL because of the outer join between application.applId *= APPL_THEMES.applId and the inner join between APPL_THEMES.theme_code = Code.code.
The part I need help with is the mapping between ApplIneThem and Cod (many-to-one). How can I get H3 to generate the SQL with an outer join between APPL_THEMES.theme_code and Code.code ?
I tried changing the fetch, outer-join and not-null properties for the association mapping but nothing worked.
DB: Sybase ASE 12.0.5
Thanks
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >
<hibernate-mapping>
<!--
Created by the Middlegen Hibernate plugin
http://boss.bekk.no/boss/middlegen/
http://hibernate.sourceforge.net/
-->
<class name="hibernate.ApplIneThem" table="APPL_THEMES">
<id name="themeId" type="java.lang.Integer" column="Theme_ID">
<generator class="native"/>
</id>
<property name="rank" type="java.lang.Short" column="Rank" length="5"/>
<property name="applId" type="java.lang.Integer" column="Appl_ID" length="7"/>
<property name="createUserId" type="java.lang.String" column="Create_User_ID" length="3" insert="false" update="false"/>
<property name="createDate" type="java.sql.Timestamp" column="Create_Date" length="23" insert="false" update="false"/>
<property name="changeUserId" type="java.lang.String" column="Change_User_ID" length="3" insert="false" update="false"/>
<property name="changeDate" type="java.util.Date" column="Change_Date" length="23" insert="false" update="false"/>
<!-- associations -->
<!-- bi-directional many-to-one association to Cod -->
<many-to-one name="codBySubThemeCode" class="hibernate.Cod" not-null="false" lazy="true" fetch="join" outer-join="auto" column="Sub_Theme_Code">
</many-to-one>
<!-- bi-directional many-to-one association to Cod -->
<many-to-one name="codByThemeCode" class="hibernate.Cod" not-null="false" lazy="true" fetch="join" outer-join="auto" column="Theme_Code"> </many-to-one>
<!--
bi-directional many-to-one association to Application
<many-to-one name="application" class="hibernate.Application" not-null="true">
<column name="Appl_ID"/>
</many-to-one>
-->
</class>
</hibernate-mapping>