A 59-year-old man has gone on trial accused of sexually assaulting six young men, some of whom were his students.
The man, who cannot be identified, has pleaded not guilty to the charges.
The jury was told that having initially denied any sexual contact with the complainants, the man later said there had been consensual sexual contact with some of the complainants.
Reporting restrictions are in place during the trial to protect the identity of the complainants.
Prosecuting Counsel Anne-Marie Lawlor told the jury it would hear allegations of sexual misconduct by a man who was a secondary school teacher in the 1990s.
Five of the complainants will say they woke up to find the man sexually assaulting them while another alleges the assault took place in a pub toilet.
Ms Lawlor told the jury that part of the "tapestry" of the case was the manner in which the accused engaged with students.
She said the jury would hear evidence that he groomed them and developed inappropriate relationships and favoured certain students.
This involved giving them alcohol and taking them to the pub, she said.
She said ultimately it involved the young men staying with him and waking up to find themselves being molested and sexually assaulted.
Three of the complainants were students aged between 17 and 18. Another was a 19-year-old who had left school.
Two other complainants, an 18-year-old and a 24-year-old were not students but knew the man from his hometown.
The jury was told it will hear that one of the complainants was 18 when it was alleged he was at a party at the home of the accused and ended up staying there as drink had been consumed.
He will say he woke to find the accused molesting him and he jumped up out of the bed and went home.
Another 18-year-old who knew the accused from his hometown will say in 1991 he was staying over in his house and woke in similar circumstances.
A then 24-year-old will tell the jury he knew the accused from a group and he woke up to his face being licked followed by what the prosecution said was a sexual assault.
A then 17-year-old student will tell the jury he was a "favoured" student and woke up to find the accused having oral sex with him and that he was allegedly "manipulated" into returning it.
He will also tell the jury there were further sexual encounters but the first was the subject of an sexual assault allegation.
A then 19-year-old who had left school at the time also alleges he was a "favourite" student of the accused and that he was molested in a toilet cubicle in a pub.
A 17-year-old will tell the jury he woke to find himself being sexually assaulted and that there was an attempt to rape him.
Ms Lawlor told the court that the ages of the complainants in the case meant they were old enough to consent but the prosecution says in these cases there was no consent and that consent cannot be given when a person is asleep.
The case is expected to last four weeks.
All of the charges are denied.