Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Make JPA keys Identity generated.
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlos A. Munoz committed Sep 18, 2015
1 parent 3113c60 commit 07f9ce5
Show file tree
Hide file tree
Showing 11 changed files with 22 additions and 11 deletions.
Expand Up @@ -24,6 +24,7 @@

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
Expand Down Expand Up @@ -64,7 +65,7 @@ public class HDocumentHistory implements IDocumentHistory {
private HDocument document;

@Id
@GeneratedValue
@GeneratedValue(strategy = GenerationType.IDENTITY)
public Long getId() {
return id;
}
Expand Down
Expand Up @@ -25,6 +25,7 @@

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
Expand All @@ -49,7 +50,7 @@ public class HDocumentUploadPart implements Serializable {
private Blob content;

@Id
@GeneratedValue
@GeneratedValue(strategy = GenerationType.IDENTITY)
public Long getId() {
return id;
}
Expand Down
Expand Up @@ -27,6 +27,7 @@
import javax.persistence.Entity;
import javax.persistence.EntityListeners;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
Expand Down Expand Up @@ -67,7 +68,7 @@ public HPersonEmailValidationKey(HPerson person, String email,
}

@Id
@GeneratedValue
@GeneratedValue(strategy = GenerationType.IDENTITY)
public Long getId() {
return id;
}
Expand Down
Expand Up @@ -29,6 +29,7 @@
import javax.persistence.Entity;
import javax.persistence.EntityListeners;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.PrePersist;
import javax.persistence.PreUpdate;
Expand Down Expand Up @@ -66,7 +67,7 @@ public HSimpleComment(String comment) {
}

@Id
@GeneratedValue
@GeneratedValue(strategy = GenerationType.IDENTITY)
public Long getId() {
return id;
}
Expand Down
Expand Up @@ -25,6 +25,7 @@
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
Expand Down Expand Up @@ -64,7 +65,7 @@ public HTermComment(String comment) {
}

@Id
@GeneratedValue
@GeneratedValue(strategy = GenerationType.IDENTITY)
public Long getId() {
return id;
}
Expand Down
3 changes: 2 additions & 1 deletion zanata-model/src/main/java/org/zanata/model/HTextFlow.java
Expand Up @@ -33,6 +33,7 @@
import javax.persistence.EntityListeners;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
Expand Down Expand Up @@ -156,7 +157,7 @@ public HTextFlow(HDocument document, String resId, String content) {
}

@Id
@GeneratedValue
@GeneratedValue(strategy = GenerationType.IDENTITY)
public Long getId() {
return id;
}
Expand Down
Expand Up @@ -29,6 +29,7 @@
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
Expand Down Expand Up @@ -67,7 +68,7 @@ public HTextFlowHistory(HTextFlow textFlow) {
}

@Id
@GeneratedValue
@GeneratedValue(strategy = GenerationType.IDENTITY)
public Long getId() {
return id;
}
Expand Down
Expand Up @@ -32,6 +32,7 @@
import javax.persistence.EntityListeners;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
Expand Down Expand Up @@ -161,7 +162,7 @@ public HTextFlowTargetHistory(HTextFlowTarget target) {
}

@Id
@GeneratedValue
@GeneratedValue(strategy = GenerationType.IDENTITY)
public Long getId() {
return id;
}
Expand Down
Expand Up @@ -28,6 +28,7 @@
import javax.persistence.Column;
import javax.persistence.EntityListeners;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;
import javax.persistence.PostPersist;
Expand Down Expand Up @@ -64,7 +65,7 @@ public class ModelEntityBase implements Serializable, HashableState {
protected Integer versionNum;

@Id
@GeneratedValue
@GeneratedValue(strategy = GenerationType.IDENTITY)
public Long getId() {
return id;
}
Expand Down
3 changes: 2 additions & 1 deletion zanata-model/src/main/java/org/zanata/model/WebHook.java
Expand Up @@ -27,6 +27,7 @@
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
Expand Down Expand Up @@ -72,7 +73,7 @@ public WebHook(HProject project, String url, String secret) {
}

@Id
@GeneratedValue
@GeneratedValue(strategy = GenerationType.IDENTITY)
public Long getId() {
return id;
}
Expand Down
Expand Up @@ -26,6 +26,7 @@
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
Expand Down Expand Up @@ -63,7 +64,7 @@ public class HPotEntryData implements Serializable {
private String references;

@Id
@GeneratedValue
@GeneratedValue(strategy = GenerationType.IDENTITY)
public Long getId() {
return id;
}
Expand Down

0 comments on commit 07f9ce5

Please sign in to comment.