One option is to have a one-to-many mapping to a List
of DayRecord
where DayRecord
is another entity containing the data you want to store. Something like:
@OneToMany
List<DayRecord> dayRecords;
...
@Entity
public class DayRecord extends Model {
@Id
private Integer id;
private Integer day;
@ManyToOne
@JoinColumn(name = "id")
private YearRecord yearRecord;
...
}
Take a look at ebean's cascade documentation as well.