CREATE SEQUENCE GEN_CO_GRUPO;
ALTER SEQUENCE GEN_CO_GRUPO RESTART WITH 0;
/* Old syntax is:
CREATE GENERATOR GEN_CO_GRUPO;
SET GENERATOR GEN_CO_GRUPO TO 0;
*/
En esta clase Java hacer referencia al Generador de firebird...
*
*@author hacosta
*/
@Entity
@Table(name="CO_GRUPO")
@SequenceGenerator(sequenceName="GEN_CO_GRUPO",name="Grupo_Seq",allocationSize=1)
@NamedQueries({
@NamedQuery(name="CoGrupo.findAll", query = "SELECT c FROM CoGrupo c")})
public class CoGrupo implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(generator="Grupo_Seq",strategy=GenerationType.SEQUENCE)
@Basic(optional= false)
@NotNull
@Column(name="ID", nullable = false)
private Integer id;
@Size(max= 50)
@Column(name="NOMBRE", length = 50)
private String nombre;
No hay comentarios:
Publicar un comentario