I'm using Hibernate with annotations and attempting for the first time to do a simple inner join on two tables in an entity class. My first table Alert has no key pointing to the second table EmailAddress. There is a one-to-many relationship between Alert and EmailAddress. EmailAddress has a column AlertId which is a foreign key to the id column of Alert.
So how do I code up the Alert class to include a List (or Set or any Collection, I don't care) of EmailAddress objects? Each entity classes work fine on their own (my Alert class currently does not contain any data members for the EmailAddress list) and I don't want to create a wrapper class that uses both of the other entity classes. I was hoping to just create an Address object when I needed one.
Omar Al Kababji
posted 7 years ago
Omar Al Kababji - Electrical & Computer Engineer
[SCJP - 90% - Story] [SCWCD - 94% - Story] [SCBCD - 80% - Story] | My Blog