-->
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.  [ 2 posts ] 
Author Message
 Post subject: Mapped View problem
PostPosted: Fri Jun 23, 2006 9:17 am 
Newbie

Joined: Fri Jun 23, 2006 8:57 am
Posts: 2
Hi,

I'm using Hibernate 3.1+Spring1.2.6 with an Oracle v9.2 database.

When retrieving object from a mapped database view, Hibernate returns a list of size 1 but with null element inside...

Here is the debug trace :

14:41:10,977 DEBUG Loader:1742 - bindNamedParameters() ALMG1S6 -> codElp [1]
14:41:10,992 DEBUG StringType:79 - binding 'ALMG1S6' to parameter: 1
14:41:11,008 DEBUG AbstractBatcher:327 - about to open ResultSet (open ResultSets: 0, globally: 0)
14:41:11,008 DEBUG Loader:682 - processing result set
14:41:11,024 DEBUG Loader:687 - result set row: 0
14:41:11,024 DEBUG StringType:123 - returning 'ALMG1S6' as column: COD1_29_0_
14:41:11,039 DEBUG StringType:116 - returning null as column: COD2_29_0_

14:41:11,039 DEBUG Loader:1164 - result row: null
14:41:11,102 DEBUG Loader:709 - done processing result set (1 rows)
14:41:11,102 DEBUG AbstractBatcher:334 - about to close ResultSet (open ResultSets: 1, globally: 1)
14:41:11,117 DEBUG AbstractBatcher:319 - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
14:41:11,117 DEBUG AbstractBatcher:470 - closing statement
14:41:11,133 DEBUG Loader:839 - total objects hydrated: 0

It seems like one result is found ("done processing result set (1 rows)" which is fine) but Hibernate don't link the result set with the returning object...

When trying the Hibernate generated request on a SQL client, all is OK.

Any idea ??
Thanks for the help.

Alex.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 23, 2006 10:07 am 
Newbie

Joined: Fri Jun 23, 2006 8:57 am
Posts: 2
For those who are interested, after searching a while, i found out that the PK mapping of my view (which has no Primary Key) was of type "composite-id" whith all field in it...

But as some column of my view could be null, a problem occurs with hibernate : finding a null value for a PK ("returning null as column: COD2_29_0_ " in trace) it exits without saying anything...

So I just declare one column as PK and others as properties and it's OK.

If you've got other solutions, i'll be pleased to heard it.

Alex.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.