The correct mapping depends on whether you want the relationship to be
unidirectional or bidirectional. The mapping you have is correct for a
bidirectional relationship, you just need to point the mappedBy attribute to
the name of the field in the Image class that holds the Category (note that
the
Hey everyone - i have a simple persistence mapping question which i am unsure
about:
I have a Category class which can many images - an image can only be in one
category. How do i map this? I've had a go but not sure if i'm correct:
= Category.class ==
@Entity
@Table(name="categories")