title: How to force eager loading in HQL
body: <p>I'm trying to force an HQL to eager load all the Lazy properties.
  Using FETCH gives me the "multiple bags" exception and I can't change it to Set as they're referenced elsewhere. I tryed other mapping Annotations but no luck.
  The "FETCH ALL PROPERTIES" is ignored and nothing is loaded. I never understood what it really does. Obviously when JSF tries to read the List I get the "cannot initialize lazy List. Connection closed"</p>
  
  <p>I'm using Hibernate 4.0.
  So here's my HQL query:</p>
  
  <pre><code>Select r from Responsavel r FETCH ALL PROPERTIES 
  where r.unidadeEmpresarial.id = :idUnidade
  </code></pre>
  
  <p>And here's my model class:</p>
  
  <pre><code>public class Responsavel {
  
  @Id
  @SequenceGenerator(name = "SQ_RESPONSAVEL_GENERATOR", sequenceName = "SE_RESPONSAVEL", allocationSize = 1)
  @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SQ_RESPONSAVEL_GENERATOR")
  @Column(name = "SQ_RESPONSAVEL")
  private Long id;
  
  @Temporal(TemporalType.DATE)
  @Column(name = "DT_FIM")
  private Date dataFim;
  
  @NotNull
  @Temporal(TemporalType.DATE)
  @Column(name = "DT_INICIO")
  private Date dataInicio;
  
  @Temporal(TemporalType.DATE)
  @Column(name = "DT_NASCIMENTO")
  private Date dataNascimento;
  
  @Type(type = "org.hibernate.type.NumericBooleanType")
  @Column(name = "IN_PODER_ADM_REPRES")
  private Boolean temPoderAdministrativo;
  
  @Column(name = "NO_RESPONSAVEL")
  private String nome;
  
  @Column(name = "NU_CPF_CNPJ_RESPONSAVEL")
  private String numeroCpfCnpj;
  
  @NotNull
  @Enumerated(EnumType.STRING)
  @Column(name = "TP_PESSOA")
  private String tipoPessoa;
  
  @ManyToOne
  @JoinColumn(name = "SQ_PAIS")
  private Pais pais;
  
  @Column(name = "VL_CAPITAL_SOCIAL")
  private BigDecimal valorCapitalSocial;
  
  @Column(name = "PC_CAPITAL_SOCIAL")
  private BigDecimal percentualCapitalSocial;
  
  @ManyToOne
  @JoinColumn(name = "SQ_UNIDADE_EMPRESARIAL")
  private UnidadeEmpresarial unidadeEmpresarial;
  
  @OneToMany(mappedBy = "responsavel", fetch = FetchType.LAZY)
  @Fetch(FetchMode.SUBSELECT)
  private Set&lt;ResponsavelQualificacaoResponsavel&gt; listaResponsavelQualificacaoResponsavel;
  
  @OneToMany(mappedBy = "responsavel")
  private List&lt;Representante&gt; representantes;
  
  @OneToMany(mappedBy = "responsavel")
  private List&lt;ContatoResponsavel&gt; contatoResponsavel;
  
  @OneToMany(mappedBy = "responsavel", cascade = CascadeType.ALL)
  private List&lt;EnderecoResponsavel&gt; enderecoResponsavel;
  
  }
  </code></pre>
  
  <p>Thanks</p>