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: UNION in Property Formula
PostPosted: Wed Sep 21, 2005 10:42 am 
Newbie

Joined: Wed Sep 21, 2005 10:27 am
Posts: 1
I'm getting the folowing generated SQL from a formula. The only problem with it is that the UNION operator is getting a "this_" appended. I've already read that formula suports "SQL Expression", so i'm confused if UNION is not supported in this context, or if i'm doing something wrong?
If it is not supported, is there any way to avoid de formula parser from appending "this", in an arbritary portion of the formula SQL ?
Thanks in advance.

Hibernate version: 3.0.5

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

The generated SQL (show_sql=true):
select * from ( select this_.UNNE_CD_N1710 as UNNE1_0_, this_.UNNE_NM_UNIDADE as UNNE2_4_0_, this_.UNNE_NR_CNPJ as UNNE3_4_0_, (select * from (( select tip.tico_nm_tipo_combustivel from tipo_combustivel tip, turbina turbina, bloco_turbina blo, bloco bloco, fase fase, empreendimento emp, unidade_negocio uni where tip.tico_cd_tipo_combustivel = turbina.tico_cd_tipo_combustivel AND (turbina.turb_cd_turbina = blo.turb_cd_turbina) AND (bloco.bloc_cd_bloco = blo.bloc_cd_bloco) AND (fase.fase_cd_fase = bloco.fase_cd_fase) AND (emp.empr_cd_empreendimento = fase.empr_cd_empreendimento) AND (uni.unne_cd_n1710 = emp.unne_cd_n1710) AND (uni.unne_cd_n1710 = uni.unne_cd_n1710) and uni.unne_cd_n1710 = (select uni.unne_cd_n1710 from tipo_combustivel tip, turbina turbina, bloco_turbina blo, bloco bloco, fase fase, empreendimento emp, unidade_negocio uni where ((tip.tico_cd_tipo_combustivel = turbina.tico_cd_tipo_combustivel) AND (turbina.turb_cd_turbina = blo.turb_cd_turbina) AND (bloco.bloc_cd_bloco = blo.bloc_cd_bloco) AND (fase.fase_cd_fase = bloco.fase_cd_fase) AND (emp.empr_cd_empreendimento = fase.empr_cd_empreendimento) AND (uni.unne_cd_n1710 = emp.unne_cd_n1710) AND (uni.unne_cd_n1710 = uni.unne_cd_n1710) and (uni.unne_cd_n1710 = uni.unne_cd_n1710)) group by uni.unne_cd_n1710 having count(uni.unne_cd_n1710) = 1 )) this_.UNION ALL ( select 'bi-combustivel' from dual)) where rownum = 1) as formula0_0_ from UNIDADE_NEGOCIO this_ where this_.UNNE_CD_N1710 like ? and this_.UNNE_NM_UNIDADE like ? order by this_.UNNE_NM_UNIDADE asc ) where rownum <= ?


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.