On 10/12/07, George.Francis <[EMAIL PROTECTED]> wrote: > > > Hi, > Hello, I have a 'Customer' entity and an 'Application' entity. Each > Application has (exactly) )one Customer, how do I correctly annotate the > Application class's Customer member variable to indicate the relationship?
So your relationship from Application to Customer is either one-to-one or many-to-one (depending on whether or not Customers can have more than one Application). You can find all the information you need to correctly annotate the classes here: one-to-one: http://www.hibernate.org/hib_docs/annotations/reference/en/html/entity.html#d0e998 many-to-one: http://www.hibernate.org/hib_docs/annotations/reference/en/html/entity.html#d0e1136 Without annotation, hibernate has created a 'customer' column in my > Application table of type 'bytea' - I assumed it would make this column of > type int instead, to store the customer_id but I assume once I have the > correct annotation this will be fixed? The bytea column is there because, in the absence of annotations on how to handle the relationship, Hibernate creates a column into which it can serialise a Customer object. Once you have correctly annotated both the Application and Customer classes it will create a column of the appropriate type to hold the Customer's identity property. Mike. -- > View this message in context: > http://www.nabble.com/Association-between-beans-tf4614424s2369.html#a13177800 > Sent from the AppFuse - User mailing list archive at Nabble.com. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
