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¡