I'm beginning with Hibernate and I read a tutorial, telling how to do one-to-many relation using annotations. Exactly what I wanted to know.
It's very simple: one course has many students.
It actually saves in the database, but in the Student table the code (of the course, FK) is NULL. The tables were created based on these annotations, it's really the same thing.
As I copied a lot of things from the tutorial (it was very alike) there are some annotations I don't know what they mean, like @JoinColumn, @Fetch and @Cascade. Are they really necessary? I'd like to keep it as simple as possible.
[ August 31, 2008: Message edited by: William Fernandes ] [ August 31, 2008: Message edited by: William Fernandes ]
"A peaceful man stands tall" — "I tremble for my country when I reflect that God is just."