I've compared the SQL generated from the HQL in the previos version (Hiberante 2.1) and this one showed in my first post.
With the same HQL I get this SQL with Hibernate 2.1:
select
country2_.country_code as country_1_0_,
currency3_.currency_code as currency1_1_,
publicatio4_.id as id2_,
product5_.product_id as product_id3_,
country2_.country_name as country_2_0_,
country2_.country_vat as country_3_0_,
country2_.country_prefix as country_4_0_,
country2_.language_code as language5_0_,
currency3_.enabled as enabled1_,
currency3_.min_px_amount as min_px_a3_1_,
currency3_.max_px_amount as max_px_a4_1_,
currency3_.min_cpa_amount as min_cpa_5_1_,
currency3_.max_cpa_amount as max_cpa_6_1_,
currency3_.min_cc_amount as min_cc_a7_1_,
currency3_.max_cc_amount as max_cc_a8_1_,
currency3_.lowest_mon_unit as lowest_m9_1_,
publicatio4_.pubid as pubid2_,
publicatio4_.publication_name as publicat3_2_,
publicatio4_.publication_ftp_time as publicat4_2_,
publicatio4_.publication_min_file_size as publicat5_2_,
publicatio4_.publication_sort_order as publicat6_2_,
publicatio4_.publication_enabled as publicat7_2_,
publicatio4_.publication_view_on_frontpage as publicat8_2_,
publicatio4_.parent_id as parent_id2_,
publicatio4_.provider as provider2_,
publicatio4_.publication_type_id as publica11_2_,
product5_.product_name as product_2_3_,
product5_.product_message_key as product_3_3_,
product5_.product_period as product_4_3_,
product5_.product_access_period as product_5_3_,
product5_.product_type_id as product_6_3_,
sale1_.sale_time as x0_0_,
country2_.country_code as x1_0_,
sale1_.cl_city as x2_0_,
currency3_.currency_code as x3_0_,
publicatio4_.id as x4_0_,
product5_.product_id as x5_0_,
sale1_.sale_pay_method as x6_0_,
saleitem0_.saleitem_amount as x7_0_
from
saleitem saleitem0_,
sale sale1_,
country country2_,
currency currency3_,
publication publicatio4_,
product product5_
where
saleitem0_.sale_id=sale1_.sale_id and
saleitem0_.sale_id=sale1_.sale_id and
sale1_.country_code=country2_.country_code and
saleitem0_.sale_id=sale1_.sale_id and
sale1_.currency_code=currency3_.currency_code and
saleitem0_.pub_id=publicatio4_.id and
saleitem0_.product_id=product5_.product_id and
((sale1_.sale_time between ? and ? and saleitem0_.sale_id=sale1_.sale_id)
and(sale1_.sale_pay_method!=? and saleitem0_.sale_id=sale1_.sale_id))
order by
sale1_.sale_time
Any suggestions anyone?
|