-->
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: Association mapping with a subselect couldn't find schema.
PostPosted: Fri Oct 29, 2010 4:59 pm 
Newbie

Joined: Fri Oct 29, 2010 2:32 pm
Posts: 1
<hibernate-mapping>
<class name="com.Person" table="Person">
<composite-id name="id" class="IDClass">
<key-property name="PNUM" type="java.lang.Integer">
<column name="PID" />
</key-property>
<key-property name="LNUM" type="java.lang.String">
<column name="LID" length="6" />
</key-property>
</composite-id>
<set name="Address" inverse="true" lazy="true"
where=" ADDRESS_CD in ('M','O','R') and ADDR_EFF_DT &lt;= CURRENT DATE
and (CURRENT DATE &lt;= ADDR_EXP_DT or ADDR_EXP_DT is null) and
CREATION_TMSTMP = (select max(add1.CREATION_TMSTMP)
from ADDRESS add1
where
add1.PID = PID
and add1.address_cd = address_cd
and add1.ADDR_EFF_DT = ADDR_EFF_DT) " >
<key>
<column name="PID" />
<column name="LID"/>
</key>
<one-to-many class="com.Address" />
</set>

When i use a "hibernate.connection.url" with "hibernate.connection.currentSchema" the schema is properly getting associated but when I used a "hibernate.default_schema" with datasource "hibernate.connection.datasource" with the below properties
<property name="hibernate.dialect">org.hibernate.dialect.DB2Dialect</property>
<property name="net.sf.hibernate.transaction.JTATransactionFactory"> net.sf.hibernate.transaction.WebSphereTransactionManagerLookup</property>


The query fired by hibernate for the association is without the schema value. Please let me know if i can circumvent this issue.

I tried with hibernate 3.3 api files.

Regards,
Subash


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.