Skip to content
Snippets Groups Projects
Commit f64c0332 authored by Filip Bugoš's avatar Filip Bugoš
Browse files

Merge branch 'entity-relationships-fix' into 'milestone-2'

Entity relationships

See merge request !27
parents 8bd5f25d 3a3cb53b
No related branches found
No related tags found
2 merge requests!30Rename microservice4, fix dockerfiles,!27Entity relationships
Pipeline #
......@@ -22,6 +22,6 @@ import java.util.List;
@Table(name = "domain_company")
public class Company extends DomainObject {
private String name;
@OneToMany
@OneToMany(mappedBy = "company")
private List<CompanyRole> employeeList;
}
......@@ -26,12 +26,9 @@ public class Device extends DomainObject {
private String name;
@OneToMany
@OneToMany(mappedBy = "device")
private List<SmartMeter> smartMeterList;
@ManyToOne
private Manufacturer manufacturer;
// Company ??
// private Company company;
}
......@@ -26,9 +26,9 @@ public class House extends DomainObject {
private String state;
private String zipcode;
@OneToMany
@OneToMany(mappedBy = "house")
private List<SmartMeter> smartMeterList;
@OneToMany
@OneToMany(mappedBy = "house")
private List<HouseRole> ownerList;
}
......@@ -24,5 +24,6 @@ public class Manufacturer extends DomainObject {
private String name;
@OneToMany private List<Device> deviceList;
@OneToMany(mappedBy = "manufacturer")
private List<Device> deviceList;
}
......@@ -33,6 +33,6 @@ public class SmartMeter extends DomainObject {
@ManyToOne
private House house;
@OneToMany
@OneToMany(mappedBy = "smartMeter")
private List<Metrics> metricsList;
}
......@@ -38,6 +38,6 @@ public class User extends DomainObject {
private String lastName;
@OneToMany
@OneToMany(mappedBy = "user")
private List<Role> rolesList;
}
......@@ -11,11 +11,13 @@ import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@Tag(name = "role", description = "Role API")
@RestController
@RequestMapping("/api/role")
public class RoleController {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment