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!