Sreyan Chakravarty wrote:@Column is used to specify the name of that column which is created in the sub table ? In the above example the column will be named "name" and the value will be varchar(50) right ?
That's indeed my understanding as well!
It's used when you have a basic collection (that's a collection of strings, integers,...). Then
@Column will be the name of the column where the strings, integers,... will be stored. With a complex type (like
Phone), the column names will be mapped in the
Phone class (and you'll use the
@Column in this class).
Hope it helps!
Kind regards,
Roel