-->
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: HQL query with an unmapped object in a subselect possible?
PostPosted: Tue Sep 13, 2005 11:27 am 
Newbie

Joined: Tue Sep 13, 2005 9:15 am
Posts: 4
I am getting a "QuerySyntaxError <table> is not mapped." error because I am including an unmapped table in a subselect of an HQL query. For me it is undesirable to create an object mapping for this table since it is being used only for filtering the results. The gist of code is below:

Code:

List myList = Carma.getHibernateConnector().getSession()
  .createQuery("from MyMappedObject as myAlias where myAlias.prop in
  (select a_column from unmapped_table)" )
  .list();



I have read the FAQs, took the reference home last night and spent several hours reading it. I have also searched for this in the forum. The topics hint at the issue, but I have found nothing directly addressing it. From what I've seen, my guess is you can't mix SQL directly accessing tables in the HQL.

Since I don't need the data from this unmapped table (I'm only using it for filtering the results), I would prefer not to create an Object mapping for it. Is this still possible to accomplish this by mapping the unmapped_table as an entity (using entity-name)? Any good examples out there?

I am continuing to try this out. Thanks in advance for your help!


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.