I got quite positive feedback from several participants and I am curious about the official ratings.
During the exercises there was the question how to define the name of a sequence when using the strategy
GenerationType.SEQUENCE
. I did not know the answer then, but here it is:
@Entity @SequenceGenerator(name="PROD_SEQ", sequenceName="product_seq") public class Product { @Id @GeneratedValue(strategy = GenerationType.SEQUENCE, generator="PROD_SEQ") long id; String title; ... }
No comments:
Post a Comment