-->
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: Ordering collections in a many-to-many association
PostPosted: Fri Aug 20, 2010 2:50 pm 
Newbie

Joined: Mon Aug 02, 2010 11:14 pm
Posts: 10
How do you sort a many to many collection association?

Code:
public class students{
private List<Schedule> schedule;
private List<Watch> watches;

//works well, can't remember the correct syntax, but ignore syntax and take in the concept of the question. so this is a double join using a bridge table...that's where the problem really lies but I want a solution.
@JoinTable("student_schedule", @JoinColumn(name="std_std_id", referenced_Column="std_id"), inverseJoinColumn(name="sch_sch_id", referenced_column="sch_id"))}
@OnetoMany(cascade=CascadeAll)
public List<Schedule> getSchedule()
{
  return schedule;
}

...
}

public class Schedule{
private Date startTime;
private String day;
...
}

public class Watch{
private String color;
}


any ideas?


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.