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: How to Use Column that is NOT Mapped in Query?
PostPosted: Tue Aug 08, 2006 5:43 pm 
Beginner
Beginner

Joined: Thu May 18, 2006 2:58 pm
Posts: 28
I found the reason for my slow query (see post http://forums.hibernate.org/viewtopic.php?t=962617&highlight=&sid=f0f45225801f7de2e86036145e3eb81f)...it was a large clob column in my table. When I removed the column from the mapping file, the query results were fast.

The problem is I need this column to perform searches. This column is an indexed column used for Intermedia context searches (Oracle).

Is there any way to use this column to query, but not have it mapped in the results?

Example query:
Code:
SELECT * from news
           WHERE CONTAINS(text, 'oracle', 1) > 0;


Top
 Profile  
 
 Post subject: Solved using Projection
PostPosted: Fri Sep 08, 2006 4:35 pm 
Beginner
Beginner

Joined: Thu May 18, 2006 2:58 pm
Posts: 28
I solved this issue by using Projection and implementing Dynamic Instantiation. In the Dynamic instantiation, I create the object leaving out the clob columns...

i.e.
Code:
select new NewsRow (news.id, new.title, .....)
from news
where contains(text, 'oracle', 1) > 0;


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.