So how exactly does the auto generate function "@GeneratedValue(strategy = GenerationType.AUTO)" work?
I'm brand new to Hibernate and have inherited a project that uses is extensively. The java object has:
@Id @GeneratedValue(strategy = GenerationType.AUTO) @Column(name="ID") private Long id;
When I create a new entity of this type, the ID is generated. Subsequent new entities have IDs incremented by 2. Where exactly is this done?
Also, it generates different IDs on our DEV and TEST environments, so somehow it is database specific. Is there a 'feeder' table/view/sequence or something?
For example, if I wanted the generated IDs to start being 100,000,XXX as opposed to 10,XXX, how would I go about making that change?
Please help out a noob. Thanks in advance.
|