-->
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.  [ 3 posts ] 
Author Message
 Post subject: Hibernate is not being Lazy !!
PostPosted: Thu Nov 16, 2006 11:00 am 
Newbie

Joined: Mon Oct 24, 2005 6:34 pm
Posts: 14
Location: Guadalajara, Jalisco. México.
Hi there ! Originally hibernate broke down with a postgres error when a huuuge query was attempted on my previous >>post<< from then on I've been watching queries wich turned out to be non lazy fetching !! even my own HQL would not fetch more than one object type in no more than, let's say, five joins, while the generated queries fetch lots and lots of colums from lots and lots of joins, in a non-lazy way, isn't lazyness supposed to be default behaviour ? How do I force hibernate to run lazy collections ? This might be afecting my server's performance and I wouldn't have ever noticed.


... any comments would be apreciated, even a "RTFM" with a useful link :)


Hibernate version: 3.2
Mapping documents: Java5 Annotations
Name and version of the database you are using: PostgreSQL

_________________
____________________________

The three programmer's virtues :
Lazyness, Impatience and Hubris.
- PerlManpages -
____________________________


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 16, 2006 11:24 am 
Expert
Expert

Joined: Tue Dec 07, 2004 6:57 am
Posts: 285
Location: Nürnberg, Germany
No one will be able help you without a mapping example / queries.

Hibernate is pretty "lazy" by default...

_________________
Please don't forget to rate


Top
 Profile  
 
 Post subject: ... is java5 the problem ?
PostPosted: Thu Nov 16, 2006 5:58 pm 
Newbie

Joined: Mon Oct 24, 2005 6:34 pm
Posts: 14
Location: Guadalajara, Jalisco. México.
... I wanted not to make the post too big, here are some examples of what's happening, this post will be huge :P

... the biggest query generated, broke down postgres with a SQL Error: 0, SQLState: 54000 ERROR: target lists can have at most 1664 entries with a query that fetched 1799 columns from 121 "real" joins, counting " left outer join ( select ... union all select ... union all ... ) as superclass " as only one join, the actual query is 130Kb txt file, I can post it if there's need. That query was executed during cascade remove, so I've no clue where it came from, but definitivelly was not hql but a collection removal, however, searching for more places where it could hapen, I've found the following:

Beans: Most of my beans have the same kind of annotations with pretty much the same parameters of cascading, here are some examples used in the fragment code below:

Code:
@SequenceGenerator(
   name="SEQ_CURSO_ID",
   sequenceName="curso_id_seq"
)
@Entity
@Table(name="curso")
@Cache(usage=CacheConcurrencyStrategy.NONSTRICT_READ_WRITE )
public class Curso extends GenericAbstractBean {
   private static Logger log = Logger.getLogger( Curso.class ) ;
   // // ------------------------------------------------------------------
   @Id
   @GeneratedValue( strategy = GenerationType.SEQUENCE , generator = "SEQ_CURSO_ID" )
   @Column (name="id")
   private int id ;
   public int getId() { return id ; }
   public void setId( int anId ) { id = anId ; }
   // // ------------------------------------------------------------------
   @OneToMany(mappedBy="curso", cascade = { CascadeType.REMOVE , CascadeType.PERSIST } )
   private Collection<Grupo> grupos ;
   @Clonable(ClonableCascadeType.CLONE_CHILD_CASCADED)
   public Collection<Grupo> getGrupos() { return grupos ; }
   public void setGrupos( Collection<Grupo> unosGrupos ) { grupos = unosGrupos ; }
   // // ------------------------------------------------------------------
   /* and many, many other fields, using the very same
   @OneToMany(mappedBy="<property>", cascade = { CascadeType.REMOVE , CascadeType.PERSIST } )
   and
   @ManyToOne @JoinColumn(name="<property>")
   or regular columns */
}


Code:
@SequenceGenerator(
   name="SEQ_GRUPO_ID",
   sequenceName="grupos_id_seq"
)

@Entity
@Table(name="grupos")
@Cache(usage=CacheConcurrencyStrategy.NONSTRICT_READ_WRITE )
public class Grupo extends GenericAbstractBean implements Comparable<Grupo> {
   // ---------------------------------------------------------------------
   @Id
   @GeneratedValue( strategy = GenerationType.SEQUENCE , generator = "SEQ_GRUPO_ID" )
   @Column (name="id")    private int id ; ;
   public int getId() { return id ; }
   public void setId( int anId ) { id = anId ; }
   // ---------------------------------------------------------------------
   @ManyToOne
   @JoinColumn(name="curso")
   private Curso curso ;
   public Curso getCurso() { return curso ; }
   public void setCurso( Curso unCurso ) { curso = unCurso ; }
   // ---------------------------------------------------------------------
   /* and many, many other fields, using the very same
   @OneToMany(mappedBy="<property>", cascade = { CascadeType.REMOVE , CascadeType.PERSIST } )
   and
   @ManyToOne @JoinColumn(name="<property>")
   or regular columns */
}


... regular beans, no fancy stuff.

... most of my beans are pretty much the same, there are 74 beans ... now take a look at this, this is so bizarre !!

Code:
log.debug("@ Obteniendo grupos ...") ;
resultGrupos = (List<Grupo>) curso.getGrupos() ;
log.debug("@ Iterando grupos ...") ;
for( Grupo grupo : resultGrupos ) {
   log.debug("@ Analizando grupo ...") ;
   // some stuff
}


... generated this output on logs (fragment):

Code:
2006-11-16 13:46:18,673 DEBUG [paquete.SincronizarSalas] @ Obteniendo grupos ...
2006-11-16 13:46:18,673 DEBUG [paquete.SincronizarSalas] @ Iterando grupos ...
2006-11-16 13:46:18,673 DEBUG [org.hibernate.SQL] <A BIG QUERY I'LL PUT AT BOTTOM>
2006-11-16 13:46:18,706 DEBUG [paquete.SincronizarSalas] @ Analizando grupo ...


Look at the logs !! they are surrounding big badass query !! query hapens in "enhanced" java 5 loop !!

... take a look at the query that hapens there, why is hibernate fetching the whole thing ? wasn't java5 supposed to be the bringer of light ?



Code:
select grupos0_.curso as curso23_,
grupos0_.id as id23_,
grupos0_.id as id555_22_,
grupos0_.curso as curso555_22_,
grupos0_.asesor as asesor555_22_,
grupos0_.nombre as nombre555_22_,
grupos0_.crn as crn555_22_,
grupos0_.cupo as cupo555_22_,
grupos0_.ancestro_id as ancestro7_555_22_,
usuario1_.id as id549_0_,
usuario1_.fechaCreacion as fechaCre2_549_0_,
usuario1_.idCentral as idCentral549_0_,
usuario1_.grupo as grupo549_0_,
usuario1_.cursoInscrito as cursoIns5_549_0_,
usuario1_.ancestro_id as ancestro6_549_0_,
grupo2_.id as id555_1_,
grupo2_.curso as curso555_1_,
grupo2_.asesor as asesor555_1_,
grupo2_.nombre as nombre555_1_,
grupo2_.crn as crn555_1_,
grupo2_.cupo as cupo555_1_,
grupo2_.ancestro_id as ancestro7_555_1_,
grupo3_.id as id555_2_,
grupo3_.curso as curso555_2_,
grupo3_.asesor as asesor555_2_,
grupo3_.nombre as nombre555_2_,
grupo3_.crn as crn555_2_,
grupo3_.cupo as cupo555_2_,
grupo3_.ancestro_id as ancestro7_555_2_,
curso4_.id as id593_3_,
curso4_.fechaCreacion as fechaCre2_593_3_,
curso4_.fechaInicio as fechaIni3_593_3_,
curso4_.fechaFin as fechaFin593_3_,
curso4_.estado as estado593_3_,
curso4_.calendarioUdG as calendar6_593_3_,
curso4_.idCentral as idCentral593_3_,
curso4_.version as version593_3_,
curso4_.mAgenda as mAgenda593_3_,
curso4_.mForos as mForos593_3_,
curso4_.mDudas as mDudas593_3_,
curso4_.mAcervos as mAcervos593_3_,
curso4_.mEventos as mEventos593_3_,
curso4_.mNotas as mNotas593_3_,
curso4_.mAvisos as mAvisos593_3_,
curso4_.mBitacora as mBitacora593_3_,
curso4_.mEvaluacion as mEvalua17_593_3_,
curso4_.mPortafolio as mPortaf18_593_3_,
curso4_.asesorTitular as asesorT22_593_3_,
curso4_.accesoAnterior as accesoA19_593_3_,
curso4_.accesoPosterior as accesoP20_593_3_,
curso4_.bannerPrincipal as bannerP23_593_3_,
curso4_.bannerSecundario as bannerS24_593_3_,
curso4_.bannerTitulo as bannerT25_593_3_,
curso4_.colorPredeterminado as colorPr21_593_3_,
curso4_.ancestro_id as ancestro26_593_3_,
usuario5_.id as id549_4_,
usuario5_.fechaCreacion as fechaCre2_549_4_,
usuario5_.idCentral as idCentral549_4_,
usuario5_.grupo as grupo549_4_,
usuario5_.cursoInscrito as cursoIns5_549_4_,
usuario5_.ancestro_id as ancestro6_549_4_,
usuario6_.id as id549_5_,
usuario6_.fechaCreacion as fechaCre2_549_5_,
usuario6_.idCentral as idCentral549_5_,
usuario6_.grupo as grupo549_5_,
usuario6_.cursoInscrito as cursoIns5_549_5_,
usuario6_.ancestro_id as ancestro6_549_5_,
archivo7_.id as id527_6_,
archivo7_.autor as autor527_6_,
archivo7_.visible as visible527_6_,
archivo7_.existe as existe527_6_,
archivo7_.publico as publico527_6_,
archivo7_.fechaEnvio as fechaEnvio527_6_,
archivo7_.nombre as nombre527_6_,
archivo7_.ancestro_id as ancestro8_527_6_,
archivo7_.titulo as titulo562_6_,
archivo7_.mime as mime562_6_,
archivo7_.ruta as ruta562_6_,
archivo7_.fechaModificacion as fechaMod5_562_6_,
archivo7_.curso as curso562_6_,
usuario8_.id as id549_7_,
usuario8_.fechaCreacion as fechaCre2_549_7_,
usuario8_.idCentral as idCentral549_7_,
usuario8_.grupo as grupo549_7_,
usuario8_.cursoInscrito as cursoIns5_549_7_,
usuario8_.ancestro_id as ancestro6_549_7_,
recurso9_.id as id527_8_,
recurso9_.autor as autor527_8_,
recurso9_.visible as visible527_8_,
recurso9_.existe as existe527_8_,
recurso9_.publico as publico527_8_,
recurso9_.fechaEnvio as fechaEnvio527_8_,
recurso9_.nombre as nombre527_8_,
recurso9_.ancestro_id as ancestro8_527_8_,
recurso9_.archivo as archivo528_8_,
recurso9_.descripcion as descripc1_528_8_,
recurso9_.referencia as referencia528_8_,
recurso9_.curso as curso528_8_,
recurso9_.descripcion as descripc1_551_8_,
recurso9_.autores as autores551_8_,
recurso9_.titulodelaobra as titulode3_551_8_,
recurso9_.editorial as editorial551_8_,
recurso9_.lugar as lugar551_8_,
recurso9_.posicion as posicion551_8_,
recurso9_.ano as ano551_8_,
recurso9_.esquema as esquema551_8_,
recurso9_.termino as termino551_8_,
recurso9_.titulo as titulo562_8_,
recurso9_.mime as mime562_8_,
recurso9_.datos as datos562_8_,
recurso9_.ruta as ruta562_8_,
recurso9_.fechaModificacion as fechaMod5_562_8_,
recurso9_.curso as curso562_8_,
recurso9_.url as url565_8_,
recurso9_.descripcion as descripc2_565_8_,
recurso9_.curso as curso565_8_,
recurso9_.curso as curso585_8_,
recurso9_.clazz_ as clazz_8_,
usuario10_.id as id549_9_,
usuario10_.fechaCreacion as fechaCre2_549_9_,
usuario10_.idCentral as idCentral549_9_,
usuario10_.grupo as grupo549_9_,
usuario10_.cursoInscrito as cursoIns5_549_9_,
usuario10_.ancestro_id as ancestro6_549_9_,
recurso11_.id as id527_10_,
recurso11_.autor as autor527_10_,
recurso11_.visible as visible527_10_,
recurso11_.existe as existe527_10_,
recurso11_.publico as publico527_10_,
recurso11_.fechaEnvio as fechaEnvio527_10_,
recurso11_.nombre as nombre527_10_,
recurso11_.ancestro_id as ancestro8_527_10_,
recurso11_.archivo as archivo528_10_,
recurso11_.descripcion as descripc1_528_10_,
recurso11_.referencia as referencia528_10_,
recurso11_.curso as curso528_10_,
recurso11_.descripcion as descripc1_551_10_,
recurso11_.autores as autores551_10_,
recurso11_.titulodelaobra as titulode3_551_10_,
recurso11_.editorial as editorial551_10_,
recurso11_.lugar as lugar551_10_,
recurso11_.posicion as posicion551_10_,
recurso11_.ano as ano551_10_,
recurso11_.esquema as esquema551_10_,
recurso11_.termino as termino551_10_,
recurso11_.titulo as titulo562_10_,
recurso11_.mime as mime562_10_,
recurso11_.datos as datos562_10_,
recurso11_.ruta as ruta562_10_,
recurso11_.fechaModificacion as fechaMod5_562_10_,
recurso11_.curso as curso562_10_,
recurso11_.url as url565_10_,
recurso11_.descripcion as descripc2_565_10_,
recurso11_.curso as curso565_10_,
recurso11_.curso as curso585_10_,
recurso11_.clazz_ as clazz_10_,
archivo12_.id as id527_11_,
archivo12_.autor as autor527_11_,
archivo12_.visible as visible527_11_,
archivo12_.existe as existe527_11_,
archivo12_.publico as publico527_11_,
archivo12_.fechaEnvio as fechaEnvio527_11_,
archivo12_.nombre as nombre527_11_,
archivo12_.ancestro_id as ancestro8_527_11_,
archivo12_.titulo as titulo562_11_,
archivo12_.mime as mime562_11_,
archivo12_.ruta as ruta562_11_,
archivo12_.fechaModificacion as fechaMod5_562_11_,
archivo12_.curso as curso562_11_,
curso13_.id as id593_12_,
curso13_.fechaCreacion as fechaCre2_593_12_,
curso13_.fechaInicio as fechaIni3_593_12_,
curso13_.fechaFin as fechaFin593_12_,
curso13_.estado as estado593_12_,
curso13_.calendarioUdG as calendar6_593_12_,
curso13_.idCentral as idCentral593_12_,
curso13_.version as version593_12_,
curso13_.mAgenda as mAgenda593_12_,
curso13_.mForos as mForos593_12_,
curso13_.mDudas as mDudas593_12_,
curso13_.mAcervos as mAcervos593_12_,
curso13_.mEventos as mEventos593_12_,
curso13_.mNotas as mNotas593_12_,
curso13_.mAvisos as mAvisos593_12_,
curso13_.mBitacora as mBitacora593_12_,
curso13_.mEvaluacion as mEvalua17_593_12_,
curso13_.mPortafolio as mPortaf18_593_12_,
curso13_.asesorTitular as asesorT22_593_12_,
curso13_.accesoAnterior as accesoA19_593_12_,
curso13_.accesoPosterior as accesoP20_593_12_,
curso13_.bannerPrincipal as bannerP23_593_12_,
curso13_.bannerSecundario as bannerS24_593_12_,
curso13_.bannerTitulo as bannerT25_593_12_,
curso13_.colorPredeterminado as colorPr21_593_12_,
curso13_.ancestro_id as ancestro26_593_12_,
archivo14_.id as id527_13_,
archivo14_.autor as autor527_13_,
archivo14_.visible as visible527_13_,
archivo14_.existe as existe527_13_,
archivo14_.publico as publico527_13_,
archivo14_.fechaEnvio as fechaEnvio527_13_,
archivo14_.nombre as nombre527_13_,
archivo14_.ancestro_id as ancestro8_527_13_,
archivo14_.titulo as titulo562_13_,
archivo14_.mime as mime562_13_,
archivo14_.ruta as ruta562_13_,
archivo14_.fechaModificacion as fechaMod5_562_13_,
archivo14_.curso as curso562_13_,
archivo15_.id as id527_14_,
archivo15_.autor as autor527_14_,
archivo15_.visible as visible527_14_,
archivo15_.existe as existe527_14_,
archivo15_.publico as publico527_14_,
archivo15_.fechaEnvio as fechaEnvio527_14_,
archivo15_.nombre as nombre527_14_,
archivo15_.ancestro_id as ancestro8_527_14_,
archivo15_.titulo as titulo562_14_,
archivo15_.mime as mime562_14_,
archivo15_.ruta as ruta562_14_,
archivo15_.fechaModificacion as fechaMod5_562_14_,
archivo15_.curso as curso562_14_,
curso16_.id as id593_15_,
curso16_.fechaCreacion as fechaCre2_593_15_,
curso16_.fechaInicio as fechaIni3_593_15_,
curso16_.fechaFin as fechaFin593_15_,
curso16_.estado as estado593_15_,
curso16_.calendarioUdG as calendar6_593_15_,
curso16_.idCentral as idCentral593_15_,
curso16_.version as version593_15_,
curso16_.mAgenda as mAgenda593_15_,
curso16_.mForos as mForos593_15_,
curso16_.mDudas as mDudas593_15_,
curso16_.mAcervos as mAcervos593_15_,
curso16_.mEventos as mEventos593_15_,
curso16_.mNotas as mNotas593_15_,
curso16_.mAvisos as mAvisos593_15_,
curso16_.mBitacora as mBitacora593_15_,
curso16_.mEvaluacion as mEvalua17_593_15_,
curso16_.mPortafolio as mPortaf18_593_15_,
curso16_.asesorTitular as asesorT22_593_15_,
curso16_.accesoAnterior as accesoA19_593_15_,
curso16_.accesoPosterior as accesoP20_593_15_,
curso16_.bannerPrincipal as bannerP23_593_15_,
curso16_.bannerSecundario as bannerS24_593_15_,
curso16_.bannerTitulo as bannerT25_593_15_,
curso16_.colorPredeterminado as colorPr21_593_15_,
curso16_.ancestro_id as ancestro26_593_15_,
curso17_.id as id593_16_,
curso17_.fechaCreacion as fechaCre2_593_16_,
curso17_.fechaInicio as fechaIni3_593_16_,
curso17_.fechaFin as fechaFin593_16_,
curso17_.estado as estado593_16_,
curso17_.calendarioUdG as calendar6_593_16_,
curso17_.idCentral as idCentral593_16_,
curso17_.version as version593_16_,
curso17_.mAgenda as mAgenda593_16_,
curso17_.mForos as mForos593_16_,
curso17_.mDudas as mDudas593_16_,
curso17_.mAcervos as mAcervos593_16_,
curso17_.mEventos as mEventos593_16_,
curso17_.mNotas as mNotas593_16_,
curso17_.mAvisos as mAvisos593_16_,
curso17_.mBitacora as mBitacora593_16_,
curso17_.mEvaluacion as mEvalua17_593_16_,
curso17_.mPortafolio as mPortaf18_593_16_,
curso17_.asesorTitular as asesorT22_593_16_,
curso17_.accesoAnterior as accesoA19_593_16_,
curso17_.accesoPosterior as accesoP20_593_16_,
curso17_.bannerPrincipal as bannerP23_593_16_,
curso17_.bannerSecundario as bannerS24_593_16_,
curso17_.bannerTitulo as bannerT25_593_16_,
curso17_.colorPredeterminado as colorPr21_593_16_,
curso17_.ancestro_id as ancestro26_593_16_,
archivo18_.id as id527_17_,
archivo18_.autor as autor527_17_,
archivo18_.visible as visible527_17_,
archivo18_.existe as existe527_17_,
archivo18_.publico as publico527_17_,
archivo18_.fechaEnvio as fechaEnvio527_17_,
archivo18_.nombre as nombre527_17_,
archivo18_.ancestro_id as ancestro8_527_17_,
archivo18_.titulo as titulo562_17_,
archivo18_.mime as mime562_17_,
archivo18_.ruta as ruta562_17_,
archivo18_.fechaModificacion as fechaMod5_562_17_,
archivo18_.curso as curso562_17_,
termino19_.id as id527_18_,
termino19_.autor as autor527_18_,
termino19_.visible as visible527_18_,
termino19_.existe as existe527_18_,
termino19_.publico as publico527_18_,
termino19_.fechaEnvio as fechaEnvio527_18_,
termino19_.nombre as nombre527_18_,
termino19_.ancestro_id as ancestro8_527_18_,
termino19_.curso as curso585_18_,
usuario20_.id as id549_19_,
usuario20_.fechaCreacion as fechaCre2_549_19_,
usuario20_.idCentral as idCentral549_19_,
usuario20_.grupo as grupo549_19_,
usuario20_.cursoInscrito as cursoIns5_549_19_,
usuario20_.ancestro_id as ancestro6_549_19_,
recurso21_.id as id527_20_,
recurso21_.autor as autor527_20_,
recurso21_.visible as visible527_20_,
recurso21_.existe as existe527_20_,
recurso21_.publico as publico527_20_,
recurso21_.fechaEnvio as fechaEnvio527_20_,
recurso21_.nombre as nombre527_20_,
recurso21_.ancestro_id as ancestro8_527_20_,
recurso21_.archivo as archivo528_20_,
recurso21_.descripcion as descripc1_528_20_,
recurso21_.referencia as referencia528_20_,
recurso21_.curso as curso528_20_,
recurso21_.descripcion as descripc1_551_20_,
recurso21_.autores as autores551_20_,
recurso21_.titulodelaobra as titulode3_551_20_,
recurso21_.editorial as editorial551_20_,
recurso21_.lugar as lugar551_20_,
recurso21_.posicion as posicion551_20_,
recurso21_.ano as ano551_20_,
recurso21_.esquema as esquema551_20_,
recurso21_.termino as termino551_20_,
recurso21_.titulo as titulo562_20_,
recurso21_.mime as mime562_20_,
recurso21_.datos as datos562_20_,
recurso21_.ruta as ruta562_20_,
recurso21_.fechaModificacion as fechaMod5_562_20_,
recurso21_.curso as curso562_20_,
recurso21_.url as url565_20_,
recurso21_.descripcion as descripc2_565_20_,
recurso21_.curso as curso565_20_,
recurso21_.curso as curso585_20_,
recurso21_.clazz_ as clazz_20_,
curso22_.id as id593_21_,
curso22_.fechaCreacion as fechaCre2_593_21_,
curso22_.fechaInicio as fechaIni3_593_21_,
curso22_.fechaFin as fechaFin593_21_,
curso22_.estado as estado593_21_,
curso22_.calendarioUdG as calendar6_593_21_,
curso22_.idCentral as idCentral593_21_,
curso22_.version as version593_21_,
curso22_.mAgenda as mAgenda593_21_,
curso22_.mForos as mForos593_21_,
curso22_.mDudas as mDudas593_21_,
curso22_.mAcervos as mAcervos593_21_,
curso22_.mEventos as mEventos593_21_,
curso22_.mNotas as mNotas593_21_,
curso22_.mAvisos as mAvisos593_21_,
curso22_.mBitacora as mBitacora593_21_,
curso22_.mEvaluacion as mEvalua17_593_21_,
curso22_.mPortafolio as mPortaf18_593_21_,
curso22_.asesorTitular as asesorT22_593_21_,
curso22_.accesoAnterior as accesoA19_593_21_,
curso22_.accesoPosterior as accesoP20_593_21_,
curso22_.bannerPrincipal as bannerP23_593_21_,
curso22_.bannerSecundario as bannerS24_593_21_,
curso22_.bannerTitulo as bannerT25_593_21_,
curso22_.colorPredeterminado as colorPr21_593_21_,
curso22_.ancestro_id as ancestro26_593_21_ from grupos grupos0_ left outer join
usuarios usuario1_ on grupos0_.asesor=usuario1_.id left outer join
grupos grupo2_ on usuario1_.grupo=grupo2_.id left outer join
grupos grupo3_ on grupo2_.ancestro_id=grupo3_.id left outer join
curso curso4_ on usuario1_.cursoInscrito=curso4_.id left outer join
usuarios usuario5_ on curso4_.asesorTitular=usuario5_.id left outer join
usuarios usuario6_ on usuario5_.ancestro_id=usuario6_.id left outer join
archivos archivo7_ on curso4_.bannerPrincipal=archivo7_.id left outer join
usuarios usuario8_ on archivo7_.autor=usuario8_.id left outer join
( select visible,
null::int4 as termino,
null::varchar as ruta,
null::varchar as titulodelaobra,
fechaEnvio,
null::date as fechaModificacion,
nombre,
id,
null::int4 as ano,
publico,
ancestro_id,
null::int4 as posicion,
autor,
null::varchar as editorial,
descripcion,
existe,
null::varchar as autores,
null::varchar as url,
referencia,
null::varchar as titulo,
curso,
archivo,
null::varchar as lugar,
null::bytea as datos,
null::varchar as mime,
null::int4 as esquema,
1 as clazz_ from documentos union all select visible,
termino,
null::varchar as ruta,
titulodelaobra,
fechaEnvio,
null::date as fechaModificacion,
nombre,
id,
ano,
publico,
ancestro_id,
posicion,
autor,
editorial,
descripcion,
existe,
autores,
null::varchar as url,
null::varchar as referencia,
null::varchar as titulo,
null::int4 as curso,
null::int4 as archivo,
lugar,
null::bytea as datos,
null::varchar as mime,
esquema,
2 as clazz_ from definiciones union all select visible,
null::int4 as termino,
ruta,
null::varchar as titulodelaobra,
fechaEnvio,
fechaModificacion,
nombre,
id,
null::int4 as ano,
publico,
ancestro_id,
null::int4 as posicion,
autor,
null::varchar as editorial,
null::varchar as descripcion,
existe,
null::varchar as autores,
null::varchar as url,
null::varchar as referencia,
titulo,
curso,
null::int4 as archivo,
null::varchar as lugar,
datos,
mime,
null::int4 as esquema,
3 as clazz_ from archivos union all select visible,
null::int4 as termino,
null::varchar as ruta,
null::varchar as titulodelaobra,
fechaEnvio,
null::date as fechaModificacion,
nombre,
id,
null::int4 as ano,
publico,
ancestro_id,
null::int4 as posicion,
autor,
null::varchar as editorial,
descripcion,
existe,
null::varchar as autores,
url,
null::varchar as referencia,
null::varchar as titulo,
curso,
null::int4 as archivo,
null::varchar as lugar,
null::bytea as datos,
null::varchar as mime,
null::int4 as esquema,
4 as clazz_ from sitios union all select visible,
null::int4 as termino,
null::varchar as ruta,
null::varchar as titulodelaobra,
fechaEnvio,
null::date as fechaModificacion,
nombre,
id,
null::int4 as ano,
publico,
ancestro_id,
null::int4 as posicion,
autor,
null::varchar as editorial,
null::varchar as descripcion,
existe,
null::varchar as autores,
null::varchar as url,
null::varchar as referencia,
null::varchar as titulo,
curso,
null::int4 as archivo,
null::varchar as lugar,
null::bytea as datos,
null::varchar as mime,
null::int4 as esquema,
5 as clazz_ from terminos ) recurso9_ on archivo7_.ancestro_id=recurso9_.id left outer join
usuarios usuario10_ on recurso9_.autor=usuario10_.id left outer join
( select visible,
null::int4 as termino,
null::varchar as ruta,
null::varchar as titulodelaobra,
fechaEnvio,
null::date as fechaModificacion,
nombre,
id,
null::int4 as ano,
publico,
ancestro_id,
null::int4 as posicion,
autor,
null::varchar as editorial,
descripcion,
existe,
null::varchar as autores,
null::varchar as url,
referencia,
null::varchar as titulo,
curso,
archivo,
null::varchar as lugar,
null::bytea as datos,
null::varchar as mime,
null::int4 as esquema,
1 as clazz_ from documentos union all select visible,
termino,
null::varchar as ruta,
titulodelaobra,
fechaEnvio,
null::date as fechaModificacion,
nombre,
id,
ano,
publico,
ancestro_id,
posicion,
autor,
editorial,
descripcion,
existe,
autores,
null::varchar as url,
null::varchar as referencia,
null::varchar as titulo,
null::int4 as curso,
null::int4 as archivo,
lugar,
null::bytea as datos,
null::varchar as mime,
esquema,
2 as clazz_ from definiciones union all select visible,
null::int4 as termino,
ruta,
null::varchar as titulodelaobra,
fechaEnvio,
fechaModificacion,
nombre,
id,
null::int4 as ano,
publico,
ancestro_id,
null::int4 as posicion,
autor,
null::varchar as editorial,
null::varchar as descripcion,
existe,
null::varchar as autores,
null::varchar as url,
null::varchar as referencia,
titulo,
curso,
null::int4 as archivo,
null::varchar as lugar,
datos,
mime,
null::int4 as esquema,
3 as clazz_ from archivos union all select visible,
null::int4 as termino,
null::varchar as ruta,
null::varchar as titulodelaobra,
fechaEnvio,
null::date as fechaModificacion,
nombre,
id,
null::int4 as ano,
publico,
ancestro_id,
null::int4 as posicion,
autor,
null::varchar as editorial,
descripcion,
existe,
null::varchar as autores,
url,
null::varchar as referencia,
null::varchar as titulo,
curso,
null::int4 as archivo,
null::varchar as lugar,
null::bytea as datos,
null::varchar as mime,
null::int4 as esquema,
4 as clazz_ from sitios union all select visible,
null::int4 as termino,
null::varchar as ruta,
null::varchar as titulodelaobra,
fechaEnvio,
null::date as fechaModificacion,
nombre,
id,
null::int4 as ano,
publico,
ancestro_id,
null::int4 as posicion,
autor,
null::varchar as editorial,
null::varchar as descripcion,
existe,
null::varchar as autores,
null::varchar as url,
null::varchar as referencia,
null::varchar as titulo,
curso,
null::int4 as archivo,
null::varchar as lugar,
null::bytea as datos,
null::varchar as mime,
null::int4 as esquema,
5 as clazz_ from terminos ) recurso11_ on recurso9_.ancestro_id=recurso11_.id left outer join
archivos archivo12_ on recurso11_.archivo=archivo12_.id left outer join
curso curso13_ on archivo12_.curso=curso13_.id left outer join
archivos archivo14_ on curso13_.bannerSecundario=archivo14_.id left outer join
archivos archivo15_ on curso13_.bannerTitulo=archivo15_.id left outer join
curso curso16_ on curso13_.ancestro_id=curso16_.id left outer join
curso curso17_ on recurso11_.curso=curso17_.id left outer join
archivos archivo18_ on recurso11_.esquema=archivo18_.id left outer join
terminos termino19_ on recurso11_.termino=termino19_.id left outer join
usuarios usuario20_ on termino19_.autor=usuario20_.id left outer join
( select visible,
null::int4 as termino,
null::varchar as ruta,
null::varchar as titulodelaobra,
fechaEnvio,
null::date as fechaModificacion,
nombre,
id,
null::int4 as ano,
publico,
ancestro_id,
null::int4 as posicion,
autor,
null::varchar as editorial,
descripcion,
existe,
null::varchar as autores,
null::varchar as url,
referencia,
null::varchar as titulo,
curso,
archivo,
null::varchar as lugar,
null::bytea as datos,
null::varchar as mime,
null::int4 as esquema,
1 as clazz_ from documentos union all select visible,
termino,
null::varchar as ruta,
titulodelaobra,
fechaEnvio,
null::date as fechaModificacion,
nombre,
id,
ano,
publico,
ancestro_id,
posicion,
autor,
editorial,
descripcion,
existe,
autores,
null::varchar as url,
null::varchar as referencia,
null::varchar as titulo,
null::int4 as curso,
null::int4 as archivo,
lugar,
null::bytea as datos,
null::varchar as mime,
esquema,
2 as clazz_ from definiciones union all select visible,
null::int4 as termino,
ruta,
null::varchar as titulodelaobra,
fechaEnvio,
fechaModificacion,
nombre,
id,
null::int4 as ano,
publico,
ancestro_id,
null::int4 as posicion,
autor,
null::varchar as editorial,
null::varchar as descripcion,
existe,
null::varchar as autores,
null::varchar as url,
null::varchar as referencia,
titulo,
curso,
null::int4 as archivo,
null::varchar as lugar,
datos,
mime,
null::int4 as esquema,
3 as clazz_ from archivos union all select visible,
null::int4 as termino,
null::varchar as ruta,
null::varchar as titulodelaobra,
fechaEnvio,
null::date as fechaModificacion,
nombre,
id,
null::int4 as ano,
publico,
ancestro_id,
null::int4 as posicion,
autor,
null::varchar as editorial,
descripcion,
existe,
null::varchar as autores,
url,
null::varchar as referencia,
null::varchar as titulo,
curso,
null::int4 as archivo,
null::varchar as lugar,
null::bytea as datos,
null::varchar as mime,
null::int4 as esquema,
4 as clazz_ from sitios union all select visible,
null::int4 as termino,
null::varchar as ruta,
null::varchar as titulodelaobra,
fechaEnvio,
null::date as fechaModificacion,
nombre,
id,
null::int4 as ano,
publico,
ancestro_id,
null::int4 as posicion,
autor,
null::varchar as editorial,
null::varchar as descripcion,
existe,
null::varchar as autores,
null::varchar as url,
null::varchar as referencia,
null::varchar as titulo,
curso,
null::int4 as archivo,
null::varchar as lugar,
null::bytea as datos,
null::varchar as mime,
null::int4 as esquema,
5 as clazz_ from terminos ) recurso21_ on termino19_.ancestro_id=recurso21_.id left outer join
curso curso22_ on termino19_.curso=curso22_.id where grupos0_.curso=?



... I'm going nuts.

_________________
____________________________

The three programmer's virtues :
Lazyness, Impatience and Hubris.
- PerlManpages -
____________________________


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

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.