Here is my SQL Query with the corresponding Oracle SQL:
Code:
SELECT * FROM (SELECT {cle.*} FROM ul_common_log_event {cle} WHERE {cle}.component_name = 'Attribute Invoked Logging: IQuoteService, SearchForQuoteAttachments' ORDER BY {cle}.observed_time DESC) WHERE ROWNUM <= 500
Hibernate:
Code:
SELECT * FROM (SELECT cle.cle_id as cle_id0_, cle.observed_time as observed2_0_, cle.version as version0_, cle.situation as situation0_, cle.message as message0_, cle.status as status0_, cle.severity as severity0_, cle.log_level as log_level0_, cle.address_type as address_9_0_, cle.address_name as address10_0_, cle.component_name as compone11_0_, cle.application_name as applica12_0_, cle.instance_name as instanc13_0_, cle.thread_name as thread_14_0_, cle.environment_name as environ15_0_ FROM ul_common_log_event cle WHERE cle.component_name = 'Attribute Invoked Logging? IQuoteService, SearchForQuoteAttachments' ORDER BY cle.observed_time DESC) WHERE ROWNUM <= 500
This SQL does the trick for one of my queries ... BUT...
I have one mapping class. My object contains two Maps, and another custom object. I need to query the data from one of the Maps using createSQLQuery().
Code:
session = sessionFactory.openSession();
Query q = session.createSQLQuery(query, "cle", CommonLogEvent.class);
result = q.list();
Can I query two tables that are part of the same object this way? I realize that I can have arrays of aliases and classes, but I only have one class.