Hello,
How can I define q query in the following condition?
- I want to get a LIST of the Player with the descending order by the
SUM(Team.score) ???
The following is my beans definition.
Bets regards,
Eric
Code:
Player.java
-------
public void setTeams(Set teams) {
this.teams = teams;
}
/**
* @hibernate.set
* lazy="true"
* table="team_player"
* order-by="teamId"
*
* @hibernate.collection-key
* column="playerId"
*
* @hibernate.collection-many-to-many
* class="test.model.Team"
* column="teamId"
*
*
*/
public Set getTeams() {
return teams;
}
Code:
Team.java
-------------
/**
* @hibernate.property
* not-null="true"
*/
public int getScore() {
return score;
}
public void setScore(int score) {
this.score = score;
}
public void setPlayers(Set players) {
this.players = players;
}
/**
* @hibernate.set
* lazy="true"
* table="team_player"
* order-by="teamId"
*
* @hibernate.collection-key
* column="teamId"
*
* @hibernate.collection-many-to-many
* class="test.model.Player"
* column="playerId"
*
*
*/
public Set getPlayers() {
return players;
}