-->
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: unmapped table
PostPosted: Thu Feb 23, 2006 10:46 am 
Newbie

Joined: Thu Feb 23, 2006 10:24 am
Posts: 1
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:3

Mapping documents:

Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:

Name and version of the database you are using:Oracle 8i

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:


Is it possible to use an unmapped table in my query for example:

String q = "select tran from PolicyTransaction tran " +
"where tran.key.contractNumber " +
"not in (SELECT CHDRNUM FROM PTRNPF_SYNC)";
Query query = session.createSQLQuery(q);

table PTRNPF_SYNC is not mapped and I don't want to include it as part of our data model, but I want this select to take into account what contracts it contains - what is the best way to achieve this behaviour?

_________________
TK - Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 23, 2006 12:01 pm 
Regular
Regular

Joined: Tue Jan 03, 2006 9:52 am
Posts: 52
Location: Zurich
Hello,

Yes, you can use any table if you use createSQLQuery(..)
The table must not be matched in this case.

For HQL however (createQuery(..)), it would not be possible.

Urs


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.