Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
3.1.1
Mapping documents:
Annotations
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
Name and version of the database you are using:
MySQL 5.0.18
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
Basic model:
CLASSROOM
// classroom has many students (unidirectional from classroom)
@ManyToMany(fetch=FetchType.LAZY)
STUDENTS
// each student has a category (unidirectional from student)
@ManyToOne(fetch=FetchType.EAGER)
CATEGORY
I'm trying to use HQL to get the list of categories for a classroom. I tried:
select c.students.category from Classroom c where c.id = :classroomId
but hibernate doesn't like that.
Any thoughts?
Thanks,
Jim