Single object reference can be defined in a straight forward way. Just define the datatype and column name would be automatically create by hibernate in schema. However, if one defines a collection to hold multiple values in hibernate, it is not that simple. One addition table is required to maintain the references with the identifiers of both values which are required to be stored.
@JoinTable(name = “shoppingcart_products”,
joinColumns = @JoinColumn(name = “user_id”),
inverseJoinColumns = @JoinColumn(name = “product_id”))
private Set shoppedProducts = new HashSet();