I am using hibernate annotations. I want to make a column as autoincremented. I have created a sequence in database(oracle) and mapped that sequence in java POJO class. Do I need to create trigger for that sequence too? I want to know how we can make a column autoincremented while using hibernate anotation? What changes i have to do in java and as well as database side? Please help me in this. Following is the part of code where I have mapped the sequence.
public class SimRuns implements Serializable {
private static final long serialVersionUID = 8698324570356602407L;
@Id @Column(name = "RUN_ID")
@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="seq_run_id")
@SequenceGenerator(name="seq_run_id", sequenceName="seq_run_id")
private Long runId;
}