Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version: annotations beta 3 and hibernate 3.0.5
Mapping documents:
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
Name and version of the database you are using:
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
My dream solution of using @Transient methods to simplify my problem didn't work out too well so I thought I'd pose the question to my fellow hibernaters. I've got a parent and child table with a one-to-many relationship. Example:
Parent
Code:
public class Person
{
@OneToMany
public List<PersonNumbers> getPersonNumbers()
{
...
}
}
ChildCode:
public class PersonNumbers
{
private String number;
private String name; // describes the number type (ssn, driver's license, etc)
@ManyToOne
public Person getPerson()
{
....
}
}
Essentially I'm using the
PersonNumbers table to keep track of a person's IDs such as driver's license and SSN. When I query for the person I want to be able to return the child table entries as columns in the resulting rows. (e.g. last name, first name,
ssn,
drivers license, birthdate). I had @Transient methods in the
Person class to explicitly get these values but can't use them as properties in HQL. So now I'm completely clueless as to how to accomplish this. All sorts of wild ideas are welcome at this point!