-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding jakarta package support for JPA Annotation.
- Loading branch information
Showing
20 changed files
with
601 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
plantuml-generator-util/src/test/java/de/elnarion/test/domain/t0021jakarta/Address.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package de.elnarion.test.domain.t0021jakarta; | ||
|
||
import jakarta.persistence.Entity; | ||
|
||
@Entity | ||
public class Address { | ||
|
||
} |
35 changes: 35 additions & 0 deletions
35
plantuml-generator-util/src/test/java/de/elnarion/test/domain/t0021jakarta/Employee.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package de.elnarion.test.domain.t0021jakarta; | ||
|
||
import jakarta.persistence.Id; | ||
import jakarta.persistence.JoinColumn; | ||
import jakarta.persistence.ManyToOne; | ||
import jakarta.persistence.MappedSuperclass; | ||
import jakarta.persistence.Version; | ||
|
||
@MappedSuperclass | ||
public class Employee { | ||
|
||
@Id | ||
protected Integer empId; | ||
@Version | ||
protected Integer version; | ||
@ManyToOne | ||
@JoinColumn(name = "ADDR") | ||
protected Address address; | ||
|
||
public Integer getEmpId() { | ||
return empId; | ||
} | ||
|
||
public void setEmpId(Integer paramId) { | ||
empId = paramId; | ||
} | ||
|
||
public Address getAddress() { | ||
return address; | ||
} | ||
|
||
public void setAddress(Address paramAddress) { | ||
address = paramAddress; | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
plantuml-generator-util/src/test/java/de/elnarion/test/domain/t0021jakarta/FTEmployee.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package de.elnarion.test.domain.t0021jakarta; | ||
|
||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.Index; | ||
import jakarta.persistence.Table; | ||
import jakarta.persistence.UniqueConstraint; | ||
|
||
@Entity | ||
@Table(name = "FTEmployee", indexes = { @Index(columnList = "salaray,empId", unique = true), | ||
@Index(columnList = "version") }, uniqueConstraints = { @UniqueConstraint(columnNames = "empId"), | ||
@UniqueConstraint(columnNames = "empId,version") }) | ||
public class FTEmployee extends Employee { | ||
|
||
// Inherited empId field mapped to FTEMPLOYEE.EMPID | ||
// Inherited version field mapped to FTEMPLOYEE.VERSION | ||
// Inherited address field mapped to FTEMPLOYEE.ADDR fk | ||
|
||
// Defaults to FTEMPLOYEE.SALARY | ||
protected Integer salary; | ||
|
||
public FTEmployee() { | ||
} | ||
|
||
public Integer getSalary() { | ||
return salary; | ||
} | ||
|
||
public void setSalary(Integer paramSalary) { | ||
this.salary = paramSalary; | ||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
plantuml-generator-util/src/test/java/de/elnarion/test/domain/t0021jakarta/Family.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package de.elnarion.test.domain.t0021jakarta; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.GeneratedValue; | ||
import jakarta.persistence.GenerationType; | ||
import jakarta.persistence.Id; | ||
import jakarta.persistence.OneToMany; | ||
|
||
@Entity | ||
public class Family { | ||
@Id | ||
@GeneratedValue(strategy = GenerationType.TABLE) | ||
private int id; | ||
private String description; | ||
|
||
@OneToMany(mappedBy = "family") | ||
private final List<Person> members = new ArrayList<Person>(); | ||
|
||
public int getId() { | ||
return id; | ||
} | ||
|
||
public void setId(int id) { | ||
this.id = id; | ||
} | ||
|
||
public String getDescription() { | ||
return description; | ||
} | ||
|
||
public void setDescription(String description) { | ||
this.description = description; | ||
} | ||
|
||
public List<Person> getMembers() { | ||
return members; | ||
} | ||
|
||
} |
40 changes: 40 additions & 0 deletions
40
plantuml-generator-util/src/test/java/de/elnarion/test/domain/t0021jakarta/Job.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package de.elnarion.test.domain.t0021jakarta; | ||
|
||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.GeneratedValue; | ||
import jakarta.persistence.GenerationType; | ||
import jakarta.persistence.Id; | ||
|
||
@Entity | ||
public class Job { | ||
@Id | ||
@GeneratedValue(strategy = GenerationType.TABLE) | ||
private int id; | ||
private double salery; | ||
private String jobDescr; | ||
|
||
public int getId() { | ||
return id; | ||
} | ||
|
||
public void setId(int id) { | ||
this.id = id; | ||
} | ||
|
||
public double getSalery() { | ||
return salery; | ||
} | ||
|
||
public void setSalery(double salery) { | ||
this.salery = salery; | ||
} | ||
|
||
public String getJobDescr() { | ||
return jobDescr; | ||
} | ||
|
||
public void setJobDescr(String jobDescr) { | ||
this.jobDescr = jobDescr; | ||
} | ||
|
||
} |
80 changes: 80 additions & 0 deletions
80
plantuml-generator-util/src/test/java/de/elnarion/test/domain/t0021jakarta/Person.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
package de.elnarion.test.domain.t0021jakarta; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.GeneratedValue; | ||
import jakarta.persistence.GenerationType; | ||
import jakarta.persistence.Id; | ||
import jakarta.persistence.ManyToOne; | ||
import jakarta.persistence.OneToMany; | ||
import jakarta.persistence.Transient; | ||
|
||
@Entity | ||
public class Person { | ||
@Id | ||
@GeneratedValue(strategy = GenerationType.TABLE) | ||
private String id; | ||
private String firstName; | ||
private String lastName; | ||
|
||
private Family family; | ||
|
||
private String nonsenseField = ""; | ||
|
||
private List<Job> jobList = new ArrayList<Job>(); | ||
|
||
public String getId() { | ||
return id; | ||
} | ||
|
||
public void setId(String Id) { | ||
this.id = Id; | ||
} | ||
|
||
public String getFirstName() { | ||
return firstName; | ||
} | ||
|
||
public void setFirstName(String firstName) { | ||
this.firstName = firstName; | ||
} | ||
|
||
// Leave the standard column name of the table | ||
public String getLastName() { | ||
return lastName; | ||
} | ||
|
||
public void setLastName(String lastName) { | ||
this.lastName = lastName; | ||
} | ||
|
||
@ManyToOne | ||
public Family getFamily() { | ||
return family; | ||
} | ||
|
||
public void setFamily(Family family) { | ||
this.family = family; | ||
} | ||
|
||
@Transient | ||
public String getNonsenseField() { | ||
return nonsenseField; | ||
} | ||
|
||
public void setNonsenseField(String nonsenseField) { | ||
this.nonsenseField = nonsenseField; | ||
} | ||
|
||
@OneToMany | ||
public List<Job> getJobList() { | ||
return this.jobList; | ||
} | ||
|
||
public void setJobList(List<Job> nickName) { | ||
this.jobList = nickName; | ||
} | ||
|
||
} |
Oops, something went wrong.