-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from qlefevre/jhipster-entities-rh-176276589173…
…3200 Add entities using the JDL model `RH`
- Loading branch information
Showing
88 changed files
with
5,372 additions
and
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"fluentMethods": true, | ||
"relationships": [], | ||
"fields": [ | ||
{ | ||
"fieldName": "date", | ||
"fieldType": "Instant" | ||
} | ||
], | ||
"changelogDate": "20180218182621", | ||
"entityTableName": "congee", | ||
"dto": "mapstruct", | ||
"pagination": "no", | ||
"service": "no", | ||
"jpaMetamodelFiltering": false, | ||
"angularJSSuffix": "mySuffix" | ||
} |
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,27 @@ | ||
{ | ||
"fluentMethods": true, | ||
"relationships": [ | ||
{ | ||
"relationshipType": "one-to-many", | ||
"relationshipName": "employees", | ||
"otherEntityName": "employee", | ||
"otherEntityRelationshipName": "department" | ||
} | ||
], | ||
"fields": [ | ||
{ | ||
"fieldName": "departmentName", | ||
"fieldType": "String", | ||
"fieldValidateRules": [ | ||
"required" | ||
] | ||
} | ||
], | ||
"changelogDate": "20180218182622", | ||
"entityTableName": "department", | ||
"dto": "mapstruct", | ||
"pagination": "no", | ||
"service": "no", | ||
"jpaMetamodelFiltering": false, | ||
"angularJSSuffix": "mySuffix" | ||
} |
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,45 @@ | ||
{ | ||
"fluentMethods": true, | ||
"relationships": [ | ||
{ | ||
"relationshipType": "one-to-one", | ||
"relationshipName": "department", | ||
"otherEntityName": "department", | ||
"otherEntityField": "id", | ||
"ownerSide": true, | ||
"otherEntityRelationshipName": "employee" | ||
}, | ||
{ | ||
"relationshipName": "department", | ||
"otherEntityName": "department", | ||
"relationshipType": "many-to-one", | ||
"otherEntityField": "id" | ||
} | ||
], | ||
"fields": [ | ||
{ | ||
"fieldName": "firstName", | ||
"fieldType": "String" | ||
}, | ||
{ | ||
"fieldName": "lastName", | ||
"fieldType": "String" | ||
}, | ||
{ | ||
"fieldName": "email", | ||
"fieldType": "String" | ||
}, | ||
{ | ||
"fieldName": "hireDate", | ||
"fieldType": "Instant" | ||
} | ||
], | ||
"changelogDate": "20180218182620", | ||
"javadoc": "The Employee entity.", | ||
"entityTableName": "employee", | ||
"dto": "mapstruct", | ||
"pagination": "no", | ||
"service": "no", | ||
"jpaMetamodelFiltering": false, | ||
"angularJSSuffix": "mySuffix" | ||
} |
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
79 changes: 79 additions & 0 deletions
79
src/main/java/io/github/jhipster/application/domain/Congee.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,79 @@ | ||
package io.github.jhipster.application.domain; | ||
|
||
import org.hibernate.annotations.Cache; | ||
import org.hibernate.annotations.CacheConcurrencyStrategy; | ||
|
||
import javax.persistence.*; | ||
|
||
import java.io.Serializable; | ||
import java.time.Instant; | ||
import java.util.Objects; | ||
|
||
/** | ||
* A Congee. | ||
*/ | ||
@Entity | ||
@Table(name = "congee") | ||
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) | ||
public class Congee implements Serializable { | ||
|
||
private static final long serialVersionUID = 1L; | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long id; | ||
|
||
@Column(name = "jhi_date") | ||
private Instant date; | ||
|
||
// jhipster-needle-entity-add-field - JHipster will add fields here, do not remove | ||
public Long getId() { | ||
return id; | ||
} | ||
|
||
public void setId(Long id) { | ||
this.id = id; | ||
} | ||
|
||
public Instant getDate() { | ||
return date; | ||
} | ||
|
||
public Congee date(Instant date) { | ||
this.date = date; | ||
return this; | ||
} | ||
|
||
public void setDate(Instant date) { | ||
this.date = date; | ||
} | ||
// jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) { | ||
return true; | ||
} | ||
if (o == null || getClass() != o.getClass()) { | ||
return false; | ||
} | ||
Congee congee = (Congee) o; | ||
if (congee.getId() == null || getId() == null) { | ||
return false; | ||
} | ||
return Objects.equals(getId(), congee.getId()); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hashCode(getId()); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "Congee{" + | ||
"id=" + getId() + | ||
", date='" + getDate() + "'" + | ||
"}"; | ||
} | ||
} |
113 changes: 113 additions & 0 deletions
113
src/main/java/io/github/jhipster/application/domain/Department.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,113 @@ | ||
package io.github.jhipster.application.domain; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnore; | ||
import org.hibernate.annotations.Cache; | ||
import org.hibernate.annotations.CacheConcurrencyStrategy; | ||
|
||
import javax.persistence.*; | ||
import javax.validation.constraints.*; | ||
|
||
import java.io.Serializable; | ||
import java.util.HashSet; | ||
import java.util.Set; | ||
import java.util.Objects; | ||
|
||
/** | ||
* A Department. | ||
*/ | ||
@Entity | ||
@Table(name = "department") | ||
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) | ||
public class Department implements Serializable { | ||
|
||
private static final long serialVersionUID = 1L; | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long id; | ||
|
||
@NotNull | ||
@Column(name = "department_name", nullable = false) | ||
private String departmentName; | ||
|
||
@OneToMany(mappedBy = "department") | ||
@JsonIgnore | ||
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) | ||
private Set<Employee> employees = new HashSet<>(); | ||
|
||
// jhipster-needle-entity-add-field - JHipster will add fields here, do not remove | ||
public Long getId() { | ||
return id; | ||
} | ||
|
||
public void setId(Long id) { | ||
this.id = id; | ||
} | ||
|
||
public String getDepartmentName() { | ||
return departmentName; | ||
} | ||
|
||
public Department departmentName(String departmentName) { | ||
this.departmentName = departmentName; | ||
return this; | ||
} | ||
|
||
public void setDepartmentName(String departmentName) { | ||
this.departmentName = departmentName; | ||
} | ||
|
||
public Set<Employee> getEmployees() { | ||
return employees; | ||
} | ||
|
||
public Department employees(Set<Employee> employees) { | ||
this.employees = employees; | ||
return this; | ||
} | ||
|
||
public Department addEmployees(Employee employee) { | ||
this.employees.add(employee); | ||
employee.setDepartment(this); | ||
return this; | ||
} | ||
|
||
public Department removeEmployees(Employee employee) { | ||
this.employees.remove(employee); | ||
employee.setDepartment(null); | ||
return this; | ||
} | ||
|
||
public void setEmployees(Set<Employee> employees) { | ||
this.employees = employees; | ||
} | ||
// jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) { | ||
return true; | ||
} | ||
if (o == null || getClass() != o.getClass()) { | ||
return false; | ||
} | ||
Department department = (Department) o; | ||
if (department.getId() == null || getId() == null) { | ||
return false; | ||
} | ||
return Objects.equals(getId(), department.getId()); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hashCode(getId()); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "Department{" + | ||
"id=" + getId() + | ||
", departmentName='" + getDepartmentName() + "'" + | ||
"}"; | ||
} | ||
} |
Oops, something went wrong.