-->
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: Sentece HQL for List attribute in a Entity Class
PostPosted: Wed Jan 12, 2011 1:44 pm 
Newbie

Joined: Wed Jan 12, 2011 1:15 pm
Posts: 11
Hello, my entity class has got a attribute that it´s a list of object from another entity class

Code:
@JoinTable(name = "participe", joinColumns = {
        @JoinColumn(name = "idactivity", referencedColumnName = "idactivity")}, inverseJoinColumns = {
        @JoinColumn(name = "iduser", referencedColumnName = "iduser")})
    @ManyToMany
   [b] private List<User> userList;[/b]


attribute´s User: idUser,email,nick,telephone,dir.

I wish to creat a query for this attribute for a specific idUser, but I´m not sure how to iterate through the HQL sentence and get a User Object with a specific idUser obtained by argument.

My idea was to do something like :

Code:
@NamedQuery(name = "Activity.findByUser", query = "SELECT a FROM Activity a WHERE [b]a.userList.idUser[/b] = :idUser")


but it´s wrong, any suggestion??

Thank you very much, grettings¡


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.