Example usage for javax.persistence GenerationType SEQUENCE

List of usage examples for javax.persistence GenerationType SEQUENCE

Introduction

In this page you can find the example usage for javax.persistence GenerationType SEQUENCE.

Prototype

GenerationType SEQUENCE

To view the source code for javax.persistence GenerationType SEQUENCE.

Click Source Link

Document

Indicates that the persistence provider must assign primary keys for the entity using a database sequence.

Usage

From source file:org.opennms.netmgt.model.OnmsNode.java

/**
 * Unique identifier for node./*w  w  w.j av  a  2s.co m*/
 *
 * @return a {@link Integer} object.
 */
@Id
@Column(name = "nodeId", nullable = false)
@SequenceGenerator(name = "nodeSequence", sequenceName = "nodeNxtId")
@GeneratedValue(generator = "nodeSequence", strategy = GenerationType.SEQUENCE)
@XmlTransient
public Integer getId() {
    return m_id;
}

From source file:org.opennms.netmgt.model.OnmsAlarm.java

/**
 * <p>getId</p>//from   w w  w  .j a  v a 2s. c  om
 *
 * @return a {@link Integer} object.
 */
@Id
@SequenceGenerator(name = "alarmSequence", sequenceName = "alarmsNxtId")
@GeneratedValue(generator = "alarmSequence", strategy = GenerationType.SEQUENCE)
@Column(name = "alarmId", nullable = false)
@XmlAttribute(name = "id")
public Integer getId() {
    return this.m_id;
}

From source file:ch.systemsx.cisd.openbis.generic.shared.dto.PropertyTypePE.java

@SequenceGenerator(name = SequenceNames.PROPERTY_TYPES_SEQUENCE, sequenceName = SequenceNames.PROPERTY_TYPES_SEQUENCE, allocationSize = 1)
@Id//from  w w w.  j  a v a2  s .  co  m
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = SequenceNames.PROPERTY_TYPES_SEQUENCE)
public Long getId() {
    return id;
}

From source file:ch.systemsx.cisd.openbis.generic.shared.dto.AttachmentPE.java

@SequenceGenerator(name = SequenceNames.ATTACHMENT_SEQUENCE, sequenceName = SequenceNames.ATTACHMENT_SEQUENCE, allocationSize = 1)
@Id//from   w  ww  . j a va  2s  .  c  o  m
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = SequenceNames.ATTACHMENT_SEQUENCE)
public final Long getId() {
    return id;
}

From source file:ch.systemsx.cisd.openbis.generic.shared.dto.ProjectPE.java

@SequenceGenerator(name = SequenceNames.PROJECT_SEQUENCE, sequenceName = SequenceNames.PROJECT_SEQUENCE, allocationSize = 1)
@Id//w w w  .j  a v  a  2 s.c  o  m
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = SequenceNames.PROJECT_SEQUENCE)
public final Long getId() {
    return id;
}

From source file:edu.harvard.med.screensaver.model.libraries.Library.java

/**
 * Get the id for the screening library.
 *
 * @return the id for the screening library
 *//*from w  ww  . j a v  a2 s .  c om*/
@Id
@org.hibernate.annotations.GenericGenerator(name = "library_id_seq", strategy = "sequence", parameters = {
        @Parameter(name = "sequence", value = "library_id_seq") })
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "library_id_seq")
public Integer getLibraryId() {
    return getEntityId();
}

From source file:ch.systemsx.cisd.openbis.generic.shared.dto.SamplePE.java

@SequenceGenerator(name = SequenceNames.SAMPLE_SEQUENCE, sequenceName = SequenceNames.SAMPLE_SEQUENCE, allocationSize = 1)
@Id/*from   ww w . j  a  v a  2  s  .  c  o  m*/
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = SequenceNames.SAMPLE_SEQUENCE)
@DocumentId
public final Long getId() {
    return id;
}

From source file:ch.systemsx.cisd.openbis.generic.shared.dto.PersonPE.java

@SequenceGenerator(name = SequenceNames.PERSON_SEQUENCE, sequenceName = SequenceNames.PERSON_SEQUENCE, allocationSize = 1)
@Id//from   ww  w.j  av  a  2 s .c  om
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = SequenceNames.PERSON_SEQUENCE)
public final Long getId() {
    return id;
}

From source file:jp.co.tis.gsp.tools.dba.dialect.OracleDialect.java

@Override
public GenerationType getGenerationType() {
    return GenerationType.SEQUENCE;
}