updates
This commit is contained in:
50
src/main/java/de/iwomm/propify_api/entity/Country.java
Normal file
50
src/main/java/de/iwomm/propify_api/entity/Country.java
Normal file
@@ -0,0 +1,50 @@
|
||||
package de.iwomm.propify_api.entity;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
@Entity
|
||||
public class Country {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.UUID)
|
||||
@Column(nullable = false)
|
||||
private UUID id;
|
||||
|
||||
private String name;
|
||||
|
||||
private String code;
|
||||
|
||||
public Country() {
|
||||
}
|
||||
|
||||
public Country(String name, String code) {
|
||||
this.name = name;
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public UUID getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(UUID id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package de.iwomm.propify_api.entity;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.UUID;
|
||||
|
||||
// @Entity
|
||||
public class EntityTemplate {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.UUID)
|
||||
@Column(nullable = false)
|
||||
private UUID id;
|
||||
|
||||
// insert other properties here
|
||||
|
||||
@Column(nullable = false)
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
@PrePersist
|
||||
protected void onCreate() {
|
||||
this.createdAt = LocalDateTime.now();
|
||||
this.updatedAt = LocalDateTime.now();
|
||||
}
|
||||
|
||||
@PreUpdate
|
||||
protected void onUpdate() {
|
||||
this.updatedAt = LocalDateTime.now();
|
||||
}
|
||||
|
||||
public UUID getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(UUID id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public LocalDateTime getCreatedAt() {
|
||||
return createdAt;
|
||||
}
|
||||
|
||||
|
||||
public LocalDateTime getUpdatedAt() {
|
||||
return updatedAt;
|
||||
}
|
||||
}
|
||||
96
src/main/java/de/iwomm/propify_api/entity/FederalState.java
Normal file
96
src/main/java/de/iwomm/propify_api/entity/FederalState.java
Normal file
@@ -0,0 +1,96 @@
|
||||
package de.iwomm.propify_api.entity;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.UUID;
|
||||
|
||||
@Entity
|
||||
public class FederalState {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.UUID)
|
||||
@Column(nullable = false)
|
||||
private UUID id;
|
||||
|
||||
private String name;
|
||||
|
||||
private String abbreviation;
|
||||
|
||||
|
||||
@ManyToOne(cascade = CascadeType.REMOVE, optional = false)
|
||||
@JoinColumn(nullable = false)
|
||||
private Country country;
|
||||
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
public FederalState(String name, String abbreviation, Country country) {
|
||||
this.name = name;
|
||||
this.abbreviation = abbreviation;
|
||||
this.country = country;
|
||||
}
|
||||
|
||||
public FederalState() {
|
||||
|
||||
}
|
||||
|
||||
public void setCountry(Country country) {
|
||||
this.country = country;
|
||||
}
|
||||
|
||||
public Country getCountry() {
|
||||
return country;
|
||||
}
|
||||
|
||||
@PrePersist
|
||||
protected void onCreate() {
|
||||
this.createdAt = LocalDateTime.now();
|
||||
this.updatedAt = LocalDateTime.now();
|
||||
}
|
||||
|
||||
@PreUpdate
|
||||
protected void onUpdate() {
|
||||
this.updatedAt = LocalDateTime.now();
|
||||
}
|
||||
|
||||
public UUID getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(UUID id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public LocalDateTime getCreatedAt() {
|
||||
return createdAt;
|
||||
}
|
||||
|
||||
public void setCreatedAt(LocalDateTime createdAt) {
|
||||
this.createdAt = createdAt;
|
||||
}
|
||||
|
||||
public LocalDateTime getUpdatedAt() {
|
||||
return updatedAt;
|
||||
}
|
||||
|
||||
public void setUpdatedAt(LocalDateTime updatedAt) {
|
||||
this.updatedAt = updatedAt;
|
||||
}
|
||||
|
||||
public String getAbbreviation() {
|
||||
return abbreviation;
|
||||
}
|
||||
|
||||
public void setAbbreviation(String abbreviation) {
|
||||
this.abbreviation = abbreviation;
|
||||
}
|
||||
}
|
||||
4
src/main/java/de/iwomm/propify_api/entity/Person.java
Normal file
4
src/main/java/de/iwomm/propify_api/entity/Person.java
Normal file
@@ -0,0 +1,4 @@
|
||||
package de.iwomm.propify_api.entity;
|
||||
|
||||
import jakarta.persistence.Entity;
|
||||
|
||||
@@ -5,6 +5,8 @@ import jakarta.persistence.*;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
@Entity
|
||||
@@ -14,11 +16,21 @@ public class Project {
|
||||
@Column(nullable = false)
|
||||
private UUID id;
|
||||
|
||||
@Column(nullable = false)
|
||||
private String name;
|
||||
private String eventNumber;
|
||||
|
||||
private String eventNumber; // Vorgangsnummer
|
||||
private String description;
|
||||
private String projectType;
|
||||
private String status;
|
||||
|
||||
|
||||
@ManyToOne(optional = false)
|
||||
@JoinColumn(nullable = false)
|
||||
private ProjectType projectType;
|
||||
|
||||
|
||||
@ManyToOne(optional = false)
|
||||
@JoinColumn(nullable = false)
|
||||
private ProjectStatus projectStatus;
|
||||
|
||||
@Column(nullable = false)
|
||||
private int amountRequested;
|
||||
@@ -34,23 +46,26 @@ public class Project {
|
||||
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
@ManyToOne(cascade = CascadeType.PERSIST, optional = false)
|
||||
@ManyToOne(optional = false)
|
||||
@JoinColumn(name = "property_id", nullable = false)
|
||||
@JsonManagedReference
|
||||
private Property property;
|
||||
|
||||
@OneToMany(mappedBy = "project", cascade = CascadeType.ALL, orphanRemoval = true)
|
||||
private List<ProjectTimelineEvent> timelineEvents = new ArrayList<>();
|
||||
|
||||
public Project() {
|
||||
this.amountRequested = 0;
|
||||
}
|
||||
|
||||
public Project(String name, String eventNumber, String description, String projectType,
|
||||
String status, Property property, int amountRequested,
|
||||
public Project(String name, String eventNumber, String description, ProjectType projectType,
|
||||
ProjectStatus status, Property property, int amountRequested,
|
||||
LocalDate startDate, LocalDate endDate) {
|
||||
this.name = name;
|
||||
this.eventNumber = eventNumber;
|
||||
this.description = description;
|
||||
this.projectType = projectType;
|
||||
this.status = status;
|
||||
this.projectStatus = status;
|
||||
this.property = property;
|
||||
this.amountRequested = amountRequested;
|
||||
this.startDate = startDate;
|
||||
@@ -100,22 +115,6 @@ public class Project {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public String getProjectType() {
|
||||
return projectType;
|
||||
}
|
||||
|
||||
public void setProjectType(String projectType) {
|
||||
this.projectType = projectType;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public int getAmountRequested() {
|
||||
return amountRequested;
|
||||
}
|
||||
@@ -163,4 +162,34 @@ public class Project {
|
||||
public void setUpdatedAt(LocalDateTime updatedAt) {
|
||||
this.updatedAt = updatedAt;
|
||||
}
|
||||
|
||||
public ProjectType getProjectType() {
|
||||
return projectType;
|
||||
}
|
||||
|
||||
public void setProjectType(ProjectType projectType) {
|
||||
this.projectType = projectType;
|
||||
}
|
||||
|
||||
public ProjectStatus getProjectStatus() {
|
||||
return projectStatus;
|
||||
}
|
||||
|
||||
public void setProjectStatus(ProjectStatus status) {
|
||||
this.projectStatus = status;
|
||||
}
|
||||
|
||||
public List<ProjectTimelineEvent> getTimelineEvents() {
|
||||
return timelineEvents;
|
||||
}
|
||||
|
||||
public void setTimelineEvents(List<ProjectTimelineEvent> timelineEvents) {
|
||||
this.timelineEvents = timelineEvents;
|
||||
}
|
||||
|
||||
public void addTimelineEvent(ProjectTimelineEvent projectTimelineEvent) {
|
||||
projectTimelineEvent.setProject(this);
|
||||
|
||||
this.timelineEvents.add(projectTimelineEvent);
|
||||
}
|
||||
}
|
||||
|
||||
77
src/main/java/de/iwomm/propify_api/entity/ProjectStatus.java
Normal file
77
src/main/java/de/iwomm/propify_api/entity/ProjectStatus.java
Normal file
@@ -0,0 +1,77 @@
|
||||
package de.iwomm.propify_api.entity;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.UUID;
|
||||
|
||||
@Entity
|
||||
public class ProjectStatus {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.UUID)
|
||||
@Column(nullable = false)
|
||||
private UUID id;
|
||||
|
||||
@Column(nullable = false)
|
||||
private String name;
|
||||
|
||||
@Column(nullable = false)
|
||||
private int sortOrder;
|
||||
|
||||
@Column(nullable = false)
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
public ProjectStatus() {
|
||||
}
|
||||
|
||||
public ProjectStatus(String name, int sortOrder) {
|
||||
this.name = name;
|
||||
this.sortOrder = sortOrder;
|
||||
}
|
||||
|
||||
@PrePersist
|
||||
protected void onCreate() {
|
||||
this.createdAt = LocalDateTime.now();
|
||||
this.updatedAt = LocalDateTime.now();
|
||||
}
|
||||
|
||||
@PreUpdate
|
||||
protected void onUpdate() {
|
||||
this.updatedAt = LocalDateTime.now();
|
||||
}
|
||||
|
||||
public UUID getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(UUID id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public LocalDateTime getCreatedAt() {
|
||||
return createdAt;
|
||||
}
|
||||
|
||||
|
||||
public LocalDateTime getUpdatedAt() {
|
||||
return updatedAt;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public int getSortOrder() {
|
||||
return sortOrder;
|
||||
}
|
||||
|
||||
public void setSortOrder(int sortOrder) {
|
||||
this.sortOrder = sortOrder;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,133 @@
|
||||
package de.iwomm.propify_api.entity;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import org.hibernate.annotations.JdbcTypeCode;
|
||||
import org.hibernate.type.SqlTypes;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
@Entity
|
||||
public class ProjectTimelineEvent {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.UUID)
|
||||
@Column(nullable = false)
|
||||
private UUID id;
|
||||
|
||||
String title;
|
||||
LocalDateTime date;
|
||||
String description;
|
||||
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "project_timeline_event_type_id")
|
||||
ProjectTimelineEventType projectTimelineEventType;
|
||||
|
||||
@ManyToOne(optional = false, fetch = FetchType.LAZY)
|
||||
@JoinColumn(name = "project_id", nullable = false)
|
||||
Project project;
|
||||
|
||||
@JdbcTypeCode(SqlTypes.JSON)
|
||||
@Column(columnDefinition = "jsonb")
|
||||
List<String> documents;
|
||||
|
||||
@Column(nullable = false)
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
public ProjectTimelineEvent() {
|
||||
}
|
||||
|
||||
public ProjectTimelineEvent(
|
||||
String title,
|
||||
LocalDateTime date,
|
||||
String description,
|
||||
ProjectTimelineEventType projectTimelineEventType,
|
||||
List<String> documents
|
||||
) {
|
||||
this.title = title;
|
||||
this.date = date;
|
||||
this.description = description;
|
||||
this.projectTimelineEventType = projectTimelineEventType;
|
||||
this.documents = documents;
|
||||
}
|
||||
|
||||
public ProjectTimelineEventType getProjectTimelineEventType() {
|
||||
return projectTimelineEventType;
|
||||
}
|
||||
|
||||
public void setProjectTimelineEventType(ProjectTimelineEventType projectTimelineEventType) {
|
||||
this.projectTimelineEventType = projectTimelineEventType;
|
||||
}
|
||||
|
||||
public void setProject(Project project) {
|
||||
this.project = project;
|
||||
}
|
||||
|
||||
public Project getProject() {
|
||||
return project;
|
||||
}
|
||||
|
||||
@PrePersist
|
||||
protected void onCreate() {
|
||||
this.createdAt = LocalDateTime.now();
|
||||
this.updatedAt = LocalDateTime.now();
|
||||
}
|
||||
|
||||
@PreUpdate
|
||||
protected void onUpdate() {
|
||||
this.updatedAt = LocalDateTime.now();
|
||||
}
|
||||
|
||||
public UUID getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(UUID id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public LocalDateTime getCreatedAt() {
|
||||
return createdAt;
|
||||
}
|
||||
|
||||
|
||||
public LocalDateTime getUpdatedAt() {
|
||||
return updatedAt;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public LocalDateTime getDate() {
|
||||
return date;
|
||||
}
|
||||
|
||||
public void setDate(LocalDateTime date) {
|
||||
this.date = date;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public List<String> getDocuments() {
|
||||
return documents;
|
||||
}
|
||||
|
||||
public void setDocuments(List<String> documents) {
|
||||
this.documents = documents;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
package de.iwomm.propify_api.entity;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.UUID;
|
||||
|
||||
@Entity
|
||||
public class ProjectTimelineEventType {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.UUID)
|
||||
@Column(nullable = false)
|
||||
private UUID id;
|
||||
|
||||
String name;
|
||||
String color;
|
||||
String icon;
|
||||
|
||||
@Column(nullable = false)
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
public ProjectTimelineEventType() {
|
||||
}
|
||||
|
||||
public ProjectTimelineEventType(String name, String color, String icon) {
|
||||
this.name = name;
|
||||
this.color = color;
|
||||
this.icon = icon;
|
||||
}
|
||||
|
||||
@PrePersist
|
||||
protected void onCreate() {
|
||||
this.createdAt = LocalDateTime.now();
|
||||
this.updatedAt = LocalDateTime.now();
|
||||
}
|
||||
|
||||
@PreUpdate
|
||||
protected void onUpdate() {
|
||||
this.updatedAt = LocalDateTime.now();
|
||||
}
|
||||
|
||||
public UUID getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(UUID id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public LocalDateTime getCreatedAt() {
|
||||
return createdAt;
|
||||
}
|
||||
|
||||
|
||||
public LocalDateTime getUpdatedAt() {
|
||||
return updatedAt;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getColor() {
|
||||
return color;
|
||||
}
|
||||
|
||||
public void setColor(String color) {
|
||||
this.color = color;
|
||||
}
|
||||
|
||||
public String getIcon() {
|
||||
return icon;
|
||||
}
|
||||
|
||||
public void setIcon(String icon) {
|
||||
this.icon = icon;
|
||||
}
|
||||
}
|
||||
75
src/main/java/de/iwomm/propify_api/entity/ProjectType.java
Normal file
75
src/main/java/de/iwomm/propify_api/entity/ProjectType.java
Normal file
@@ -0,0 +1,75 @@
|
||||
package de.iwomm.propify_api.entity;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.UUID;
|
||||
|
||||
@Entity
|
||||
public class ProjectType {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.UUID)
|
||||
@Column(nullable = false)
|
||||
private UUID id;
|
||||
|
||||
private String name;
|
||||
|
||||
private int sortOrder;
|
||||
|
||||
public ProjectType() {
|
||||
}
|
||||
|
||||
public ProjectType(String name, int sortOrder) {
|
||||
this.name = name;
|
||||
this.sortOrder = sortOrder;
|
||||
}
|
||||
|
||||
@Column(nullable = false)
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
@PrePersist
|
||||
protected void onCreate() {
|
||||
this.createdAt = LocalDateTime.now();
|
||||
this.updatedAt = LocalDateTime.now();
|
||||
}
|
||||
|
||||
@PreUpdate
|
||||
protected void onUpdate() {
|
||||
this.updatedAt = LocalDateTime.now();
|
||||
}
|
||||
|
||||
public UUID getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(UUID id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public LocalDateTime getCreatedAt() {
|
||||
return createdAt;
|
||||
}
|
||||
|
||||
|
||||
public LocalDateTime getUpdatedAt() {
|
||||
return updatedAt;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public int getSortOrder() {
|
||||
return sortOrder;
|
||||
}
|
||||
|
||||
public void setSortOrder(int sortOrder) {
|
||||
this.sortOrder = sortOrder;
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package de.iwomm.propify_api.entity;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonBackReference;
|
||||
import jakarta.persistence.*;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
@@ -17,6 +18,8 @@ public class Property {
|
||||
@Column(nullable = false)
|
||||
private String name;
|
||||
|
||||
private String owner;
|
||||
|
||||
@Column(nullable = false)
|
||||
private String street;
|
||||
|
||||
@@ -29,10 +32,18 @@ public class Property {
|
||||
@Column(nullable = false)
|
||||
private String city;
|
||||
|
||||
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "federal_state_id")
|
||||
private FederalState federalState;
|
||||
|
||||
private String notes;
|
||||
|
||||
@Column(nullable = false)
|
||||
private String country;
|
||||
private int yearOfConstruction; // baujahr
|
||||
|
||||
@Column(nullable = false)
|
||||
private int unitCount; // anzahl einheiten
|
||||
|
||||
@OneToMany(mappedBy = "property", orphanRemoval = true)
|
||||
@OrderBy("fileName")
|
||||
@@ -48,6 +59,18 @@ public class Property {
|
||||
@JsonBackReference
|
||||
private List<Project> projects = new ArrayList<>();
|
||||
|
||||
@ManyToOne(optional = false)
|
||||
@JoinColumn(name = "property_status_id", nullable = false)
|
||||
private PropertyStatus propertyStatus;
|
||||
|
||||
public PropertyStatus getPropertyStatus() {
|
||||
return propertyStatus;
|
||||
}
|
||||
|
||||
public void setPropertyStatus(PropertyStatus propertyStatus) {
|
||||
this.propertyStatus = propertyStatus;
|
||||
}
|
||||
|
||||
public List<Project> getProjects() {
|
||||
return projects;
|
||||
}
|
||||
@@ -67,14 +90,19 @@ public class Property {
|
||||
|
||||
public Property() {}
|
||||
|
||||
public Property(String name, String street, String houseNumber, String zipCode, String city, String country, String notes) {
|
||||
public Property(
|
||||
String name, String street, String houseNumber,
|
||||
String zipCode, String city,
|
||||
FederalState federalState,
|
||||
String notes, PropertyStatus propertyStatus) {
|
||||
this.name = name;
|
||||
this.street = street;
|
||||
this.houseNumber = houseNumber;
|
||||
this.zipCode = zipCode;
|
||||
this.city = city;
|
||||
this.country = country;
|
||||
this.federalState = federalState;
|
||||
this.notes = notes;
|
||||
this.propertyStatus = propertyStatus;
|
||||
}
|
||||
|
||||
@PrePersist
|
||||
@@ -152,14 +180,6 @@ public class Property {
|
||||
this.city = city;
|
||||
}
|
||||
|
||||
public String getCountry() {
|
||||
return country;
|
||||
}
|
||||
|
||||
public void setCountry(String country) {
|
||||
this.country = country;
|
||||
}
|
||||
|
||||
public String getNotes() {
|
||||
return this.notes;
|
||||
}
|
||||
@@ -167,4 +187,36 @@ public class Property {
|
||||
public void setNotes(String notes) {
|
||||
this.notes = notes;
|
||||
}
|
||||
|
||||
public String getOwner() {
|
||||
return owner;
|
||||
}
|
||||
|
||||
public void setOwner(String owner) {
|
||||
this.owner = owner;
|
||||
}
|
||||
|
||||
public int getYearOfConstruction() {
|
||||
return yearOfConstruction;
|
||||
}
|
||||
|
||||
public void setYearOfConstruction(int yearOfConstruction) {
|
||||
this.yearOfConstruction = yearOfConstruction;
|
||||
}
|
||||
|
||||
public int getUnitCount() {
|
||||
return unitCount;
|
||||
}
|
||||
|
||||
public void setUnitCount(int unitCount) {
|
||||
this.unitCount = unitCount;
|
||||
}
|
||||
|
||||
public FederalState getFederalState() {
|
||||
return federalState;
|
||||
}
|
||||
|
||||
public void setFederalState(FederalState federalState) {
|
||||
this.federalState = federalState;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
package de.iwomm.propify_api.entity;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
@Entity
|
||||
public class PropertyStatus {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.UUID)
|
||||
@Column(nullable = false)
|
||||
private UUID id;
|
||||
|
||||
@Column(nullable = false)
|
||||
private String name;
|
||||
|
||||
@Column(nullable = false)
|
||||
private int sortOrder;
|
||||
|
||||
@OneToMany(mappedBy = "propertyStatus", orphanRemoval = true)
|
||||
private Set<Property> properties = new LinkedHashSet<>();
|
||||
|
||||
public PropertyStatus() {
|
||||
|
||||
}
|
||||
|
||||
public Set<Property> getProperties() {
|
||||
return properties;
|
||||
}
|
||||
|
||||
public void setProperties(Set<Property> properties) {
|
||||
this.properties = properties;
|
||||
}
|
||||
|
||||
public PropertyStatus(String name, int sortOrder) {
|
||||
this.name = name;
|
||||
this.sortOrder = sortOrder;
|
||||
}
|
||||
|
||||
public UUID getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(UUID id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public int getSortOrder() {
|
||||
return sortOrder;
|
||||
}
|
||||
|
||||
public void setSortOrder(int order) {
|
||||
this.sortOrder = order;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user