I wanted to generate sequence using hibernate tool ( pojo to sql). And definitely it works fine.
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "seqid-gen") @SequenceGenerator(name = "seqid-gen", sequenceName = "RTDS_ADSINPUT_SEQ" ) @Column(name="id") public Long getId() { return id; } This code generates below sql
create sequence RTDS_ADSINPUT_SEQ; The problem is I wanted to specify properties like
START WITH, INCREMENT BY, NOCACHE and the final ddl script should be some thing like below
CREATE SEQUENCE RTDS_ADSINPUT_SEQ MINVALUE 1 MAXVALUE 999999999999999999 INCREMENT BY 1 START WITH 1 NOCACHE; But as far I saw hibernate only support name, sequncename, allocationSize, initialvalue. My doubt is, if we use allocationSize = 1 & initialValue = 1 do we still need to mention "nocache". If so, do we have any kind of annotation for "nocache"?
Please advice me if I can include that properties as annotation in the pojo.