Beyond EJB3, Hibernate Annotations supports true
List and Array. Map your collection the same way as usual and add the @IndexColumn. This annotation allows you to describe the column that will hold the index. You can also declare the index value in DB that represent the first element (aka as base index). The usual value is 0 or 1.
@OneToMany(cascade = CascadeType.ALL)
@IndexColumn(name = "drawer_position", base=1)
public List<Drawer> getDrawers() {
return drawers;
}Note
If you forgot to set
@IndexColumn, the bag semantic is applied. If you want the bag semantic without the limitations of it, consider using @CollectionId.