javax.persistence.GenerationType Java Examples

The following examples show how to use javax.persistence.GenerationType. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source Project: sample-java-spring-genericdao   Author: herlanijunior   File: Instructor.java    License: Apache License 2.0 5 votes vote down vote up
@Id
@Column(name = "INSTRUCTOR_ID", unique = true, nullable = false)
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_INSTRUCTOR_ID")
@SequenceGenerator(name = "SEQ_INSTRUCTOR_ID", sequenceName = "SEQ_INSTRUCTOR_ID", allocationSize=1, initialValue=1)
public Integer getId() {
	return this.id;
}
 
Example #2
Source Project: ankush   Author: Impetus   File: Log.java    License: GNU Lesser General Public License v3.0 5 votes vote down vote up
/**
 * Gets the id.
 * 
 * @return the id
 */
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@JsonIgnore
public Long getId() {
	return id;
}
 
Example #3
Source Project: cia   Author: Hack23   File: CommitteeProposalContainer.java    License: Apache License 2.0 5 votes vote down vote up
/**
* Gets the hjid.
*
* @return the hjid
*/
  @Id
  @Column(name = "HJID")
  @GeneratedValue(strategy = GenerationType.AUTO)
  public Long getHjid() {
      return hjid;
  }
 
Example #4
Source Project: cia   Author: Hack23   File: DocumentStatusContainer.java    License: Apache License 2.0 5 votes vote down vote up
/**
* Gets the hjid.
*
* @return the hjid
*/
  @Id
  @Column(name = "HJID")
  @GeneratedValue(strategy = GenerationType.AUTO)
  public Long getHjid() {
      return hjid;
  }
 
Example #5
Source Project: cia   Author: Hack23   File: PersonContainerElement.java    License: Apache License 2.0 5 votes vote down vote up
/**
* Gets the hjid.
*
* @return the hjid
*/
  @Id
  @Column(name = "HJID")
  @GeneratedValue(strategy = GenerationType.AUTO)
  public Long getHjid() {
      return hjid;
  }
 
Example #6
Source Project: sample-java-spring-genericdao   Author: herlanijunior   File: Classes.java    License: Apache License 2.0 5 votes vote down vote up
@Id
@Column(name = "CLASSES_ID", unique = true, nullable = false)
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_CLASSES_ID")
@SequenceGenerator(name = "SEQ_CLASSES_ID", sequenceName = "SEQ_CLASSES_ID", allocationSize=1, initialValue=1)
public Integer getId() {
	return this.id;
}
 
Example #7
Source Project: cia   Author: Hack23   File: SwedenParliamentElectoralRegionContainer.java    License: Apache License 2.0 5 votes vote down vote up
/**
* Gets the hjid.
*
* @return the hjid
*/
  @Id
  @Column(name = "HJID")
  @GeneratedValue(strategy = GenerationType.AUTO)
  public Long getHjid() {
      return hjid;
  }
 
Example #8
Source Project: tianti   Author: xujeff   File: OracleLongEntity.java    License: Apache License 2.0 5 votes vote down vote up
@Id
@SequenceGenerator(name = "ID_SEQ")
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "ID_SEQ")
@Column(name = "ID", nullable = false)
public Long getId() {
	return id;
}
 
Example #9
Source Project: cia   Author: Hack23   File: CountryElement.java    License: Apache License 2.0 5 votes vote down vote up
/**
* Gets the hjid.
*
* @return the hjid
*/
  @Id
  @Column(name = "HJID")
  @GeneratedValue(strategy = GenerationType.AUTO)
  public Long getHjid() {
      return hjid;
  }
 
Example #10
Source Project: cia   Author: Hack23   File: DocumentDetailData.java    License: Apache License 2.0 5 votes vote down vote up
/**
* Gets the hjid.
*
* @return the hjid
*/
  @Id
  @Column(name = "HJID")
  @GeneratedValue(strategy = GenerationType.AUTO)
  public Long getHjid() {
      return hjid;
  }
 
Example #11
Source Project: opensharding-spi-impl-example   Author: OpenSharding   File: OrderItemEntity.java    License: Apache License 2.0 5 votes vote down vote up
@Id
@Column(name = "order_item_id")
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Override
public long getOrderItemId() {
    return super.getOrderItemId();
}
 
Example #12
Source Project: opensharding-spi-impl-example   Author: OpenSharding   File: OrderEntity.java    License: Apache License 2.0 5 votes vote down vote up
@Id
@Column(name = "order_id")
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Override
public long getOrderId() {
    return super.getOrderId();
}
 
Example #13
Source Project: dpCms   Author: summerDp   File: Menu.java    License: Apache License 2.0 5 votes vote down vote up
@Id
@Column(name = "ID", unique = true, nullable = false, length = 19)
@GeneratedValue(strategy = GenerationType.TABLE, generator = "table")
@GenericGenerator(name = "table", strategy = "org.hibernate.id.MultipleHiLoPerTableGenerator", parameters = {
		@Parameter(name = "max_lo", value = "5") })//增长级别为5,可根据并发级别适当调整
public Long getId() {
	return this.id;
}
 
Example #14
Source Project: cia   Author: Hack23   File: SwedenElectionTypeContainerElement.java    License: Apache License 2.0 5 votes vote down vote up
/**
* Gets the hjid.
*
* @return the hjid
*/
  @Id
  @Column(name = "HJID")
  @GeneratedValue(strategy = GenerationType.AUTO)
  public Long getHjid() {
      return hjid;
  }
 
Example #15
Source Project: lams   Author: lamsfoundation   File: BinderHelper.java    License: GNU General Public License v2.0 5 votes vote down vote up
@SuppressWarnings("ConstantConditions")
private static GenerationType interpretGenerationType(GeneratedValue generatedValueAnn) {
	if ( generatedValueAnn.strategy() == null ) {
		return GenerationType.AUTO;
	}

	return generatedValueAnn.strategy();
}
 
Example #16
Source Project: jeewx   Author: zhangdaiscott   File: WebOfficeEntity.java    License: Apache License 2.0 5 votes vote down vote up
/**
 *方法: 取得java.lang.Integer
 *@return: java.lang.Integer  id
 */

@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name ="ID",nullable=false,length=32)
public java.lang.Integer getId(){
	return this.id;
}
 
Example #17
Source Project: uyuni   Author: uyuni-project   File: EnvironmentTarget.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Gets the id.
 *
 * @return id
 */
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "content_prj_env_target_seq")
@SequenceGenerator(name = "content_prj_env_target_seq", sequenceName = "suse_ct_env_tgt_seq", allocationSize = 1)
public Long getId() {
    return id;
}
 
Example #18
Source Project: cia   Author: Hack23   File: Topics.java    License: Apache License 2.0 5 votes vote down vote up
/**
* Gets the hjid.
*
* @return the hjid
*/
  @Id
  @Column(name = "HJID")
  @GeneratedValue(strategy = GenerationType.AUTO)
  public Long getHjid() {
      return hjid;
  }
 
Example #19
Source Project: cia   Author: Hack23   File: SwedenElectionType.java    License: Apache License 2.0 5 votes vote down vote up
/**
* Gets the hjid.
*
* @return the hjid
*/
  @Id
  @Column(name = "HJID")
  @GeneratedValue(strategy = GenerationType.AUTO)
  public Long getHjid() {
      return hjid;
  }
 
Example #20
Source Project: uyuni   Author: uyuni-project   File: ContentProject.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Gets the id.
 *
 * @return id
 */
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "content_project_seq")
@SequenceGenerator(name = "content_project_seq", sequenceName = "suse_ct_project_seq", allocationSize = 1)
public Long getId() {
    return id;
}
 
Example #21
Source Project: uyuni   Author: uyuni-project   File: NotificationMessage.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * @return Returns the id.
 */
@Id
@Column(name = "id")
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "nmsg_seq")
@SequenceGenerator(name = "nmsg_seq", sequenceName = "suse_notif_message_id_seq",
        allocationSize = 1)
public Long getId() {
    return id;
}
 
Example #22
Source Project: uyuni   Author: uyuni-project   File: ImageInfo.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * @return the id
 */
@Id
@Column(name = "id")
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "imginfo_seq")
@SequenceGenerator(name = "imginfo_seq", sequenceName = "suse_imginfo_imgid_seq",
                   allocationSize = 1)
public Long getId() {
    return id;
}
 
Example #23
Source Project: cia   Author: Hack23   File: WorldBankData.java    License: Apache License 2.0 5 votes vote down vote up
/**
* Gets the hjid.
*
* @return the hjid
*/
  @Id
  @Column(name = "HJID")
  @GeneratedValue(strategy = GenerationType.AUTO)
  public Long getHjid() {
      return hjid;
  }
 
Example #24
Source Project: uyuni   Author: uyuni-project   File: Cluster.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * @return id to get
 */
@Id
@Column(name = "id")
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "clust_seq")
@SequenceGenerator(name = "clust_seq", sequenceName = "suse_cluster_id_seq",
        allocationSize = 1)
public long getId() {
    return id;
}
 
Example #25
Source Project: cia   Author: Hack23   File: DocumentProposalData.java    License: Apache License 2.0 5 votes vote down vote up
/**
* Gets the hjid.
*
* @return the hjid
*/
  @Id
  @Column(name = "HJID")
  @GeneratedValue(strategy = GenerationType.AUTO)
  public Long getHjid() {
      return hjid;
  }
 
Example #26
Source Project: cia   Author: Hack23   File: SwedenElectionRegion.java    License: Apache License 2.0 5 votes vote down vote up
/**
* Gets the hjid.
*
* @return the hjid
*/
  @Id
  @Column(name = "HJID")
  @GeneratedValue(strategy = GenerationType.AUTO)
  public Long getHjid() {
      return hjid;
  }
 
Example #27
Source Project: tutorials   Author: eugenp   File: Car.java    License: MIT License 4 votes vote down vote up
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "ID", unique = true, nullable = false, scale = 0)
public long getId() {
    return id;
}
 
Example #28
Source Project: Spring-5.0-Cookbook   Author: PacktPublishing   File: LoginDetails.java    License: MIT License 4 votes vote down vote up
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
public Integer getId() {
	return id;
}
 
Example #29
Source Project: juddi   Author: apache   File: CategoryBag.java    License: Apache License 2.0 4 votes vote down vote up
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
public Long getId() {
	return this.id;
}
 
Example #30
Source Project: juddi   Author: apache   File: ServiceName.java    License: Apache License 2.0 4 votes vote down vote up
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
public Long getId() {
	return this.id;
}