-->
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: HQL and Collections
PostPosted: Thu Jul 23, 2009 7:50 am 
Newbie

Joined: Thu Jul 23, 2009 7:26 am
Posts: 1
Friends,

I have a problem with Lazy Loading. Our plataform donĀ“t support (Flex / BlazeDS).

Can u help me to mount this query?
1 Atendimento have 1 collection of ExameServico. OneToMany
1 ExameServico have 1 Exame only.

I need to bring: "protocolo" of Atendimento,
Atendimento collection of ExameServico (only the dataExameServico),
and each Exame of ExameServico Collection (only nome).

Code:
public class Atendimento {
    @Id
    @GeneratedValue
    private long id;

    @OneToMany(fetch = FetchType.LAZY)
    private List<ExameServico> exames;

    private String protocolo;

// getters e setters
}


Code:
public class ExameServico {
    @Id
    @GeneratedValue
    private long id;

    @ManyToOne
    private Exame exame;

    private Date dataExameServico;

// getters e setters
}


Code:
public class Exame {
    @Id
    @GeneratedValue
    private long id;

    private String nome;

// getters e setters
}



Sorry about english.


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.