-->
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.  [ 3 posts ] 
Author Message
 Post subject: fetch="select" not working on a many-to-one relati
PostPosted: Fri Jan 11, 2008 8:27 am 
Newbie

Joined: Thu Apr 26, 2007 9:42 am
Posts: 14
Hi,

I'm using Hibernate 3.2.1.ga and DB2 database.

I have the next entity:

<?xml version="1.0"?>

<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping default-cascade="refresh">
<class name="VehicleInstanceTechnicalData"
table="VEHICLE_INSTANCE_TECH_DATA">
<id name="entityId" column="VEHICLEINSTTECHDATAID">
<generator class="sequence">
<param name="sequence">VEHICLEINSTANCETECHDATAIDSEQUENCE</param>
</generator>
</id>

<version name="versionNo"
column="VEHICLEINSTTECHDATAVERSIONNO" />

<many-to-one name="vehicleInstance" class="VehicleInstance"
column="VEHICLEINSTANCEID"
unique="true"
not-null="true" />
</class>

</hibernate-mapping>


When I saved a VehicleInstanceTechnicalData entity Hibernate does an refresh on the entity due to the mapping default-cascade="refresh".

It generates a SELECT on the VEHICLE_INSTANCE_TECH_DATA table and this SELECT contains a join with the VEHICLE_INSTANCE table (mapped to vehicleInstance from the many-to-one relation) instead of generating a second SELECT for the VEHICLE_INSTANCE table.

This works correctly with Hibernate 3.1.rc2 version, I mean it generates a second SELECT for VEHICLE_INSTANCE table.

It seems that in Hibernate 3.2.1.ga the default fetch="select" on many-to-one relation doesn't work correctly.
I tried to put fetch="select" on the many-to-one relation but it is the same thing.
The same it happens with Hibernate 3.2.5.ga.

Thanks in advance for any suggestion,
Cristian.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 14, 2008 3:50 am 
Newbie

Joined: Thu Apr 26, 2007 9:42 am
Posts: 14
In Hibernate 3.1.3 are generated others SELECTs for many-to-one relations.
The problem appears starting from version 3.2.0.cr3.

I have many-to-one relations and in DB2 I have the next error:
DB2 SQL error: SQLCODE: -840, SQLSTATE: 54004, SQLERRMC: null

The problem is that in DB2 returns the error :"The statement include to many columns, more than 1012, and I have 1169". If Hibernate would generate sequential selects, the problem would be resolved.


Top
 Profile  
 
 Post subject: Same problem
PostPosted: Wed Feb 04, 2009 11:28 am 
Newbie

Joined: Wed Feb 04, 2009 11:15 am
Posts: 1
I'm having the same problem with Hibernates Select statement not being generated correctly.

Does anyone have a solution for this problem?

If it is a bug how do we get it fixed?


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

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.