The name seq1 is then referenced as the generator attribute of the annotation. This refers to the database sequence object called HIB_SEQ. Here, a sequence-generation annotation named seq1 has been declared. To declare the specific sequence object to use and its properties, you must include the annotation on the annotated field. It is similar to the use of an identity column type, except that a sequence is independent of any particular table and can therefore be used by multiple tables. Generating Primary Key Values with sequence is a database object that can be used as a source of primary key values. It uses generator attribute allows the use of a custom generation mechanism shown in the above code example. It uses TABLE: This type keeps a separate table with the primary key values.
0 Comments
Leave a Reply. |