Prior knowledge or experience in database programming (SQL, JDBC, ORM, JPA, etc.) is not required, but some background in using the Java language is essential.
Internal Website Search1-10 of 27 resultsRefresh
Hi, I have a question about @SequenceGenerator. I have separate @SequenceGenerator in each ... classes: By using multiple @SequenceGenerator and/or @TableGenerator definitions (with different name ... the part about strategy type. Each of my model class got following annotations: @SequenceGenerator
javax.persistence Annotation SequenceGenerator Target: Classes and fields (including property get methods) Defines a primary key generator that may be referenced by name when a generator element ... to the persistence unit (across all generator types). Example: @SequenceGenerator(name="EMP_SEQ
Annotation Element javax.persistence.SequenceGenerator String sequenceName (Optional) The name of the database sequence object from which to obtain primary key values. Defaults to a provider-chosen value. Default value: "" Since: JPA 1.0
Annotation Element javax.persistence.SequenceGenerator String schema (Optional) The schema of the sequence generator. Default value: "" Since: JPA 2.0
Annotation Element javax.persistence.SequenceGenerator String name (Required) A unique generator name that can be referenced by one or more classes to be the generator for primary key values. Since: JPA 1.0
Annotation Element javax.persistence.SequenceGenerator int initialValue (Optional) The value from which the sequence object is to start generating. Default value: 1 Since: JPA 1.0
Annotation Element javax.persistence.SequenceGenerator String catalog (Optional) The catalog of the sequence generator. Default value: "" Since: JPA 2.0
Annotation Element javax.persistence.SequenceGenerator int allocationSize (Optional) The amount to increment by when allocating sequence numbers from the sequence. Default value: 50 Since: JPA 1.0
and using the named sequence in one or more fields in one or more classes. The @SequenceGenerator ... a sequence - might also be in another class: @SequenceGenerator(name="seq", initialValue=1, allocationSize ... sequence numbers to start with 1 in the TABLE strategy initialValue=0 has to be specified in the @SequenceGenerator annotation.
Reference (JavaDoc) of JPA 2 value generation annotations, including @GeneratedValue, @SequenceGenerator and @TableGenerator.