-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Help with mapping
PostPosted: Tue Sep 27, 2005 2:12 pm 
Regular
Regular

Joined: Thu Aug 19, 2004 9:28 am
Posts: 63
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>


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.