-2
i have two classes one of user and one of request, my user class has roles and in the order class I want to know who was the employee and the client who made the request and am having this error mappedBy Reference an Unknown target Entity Property.
User class:
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private String username;
@JsonIgnore
@NotEmpty
private String password;
@Email
private String email;
private BigDecimal balance;
@JsonIgnore
@OneToMany(mappedBy = "user")
private List<Order> orders = new ArrayList<>();
@ElementCollection
@CollectionTable(name="TELEFONE")
private Set<String> telefones = new HashSet<>();
@ElementCollection(fetch=FetchType.EAGER)
@CollectionTable(name="ROLES")
private Set<Integer> roles = new HashSet<>();
Order class
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@ManyToOne
@JoinColumn(name = "user_id")
private User costumer;
@ManyToOne
@JoinColumn(name = "user_id")
private User employer;
private Payment payment;
@OneToMany(mappedBy = "id.order")
private Set<ItemOrder> items = new HashSet<>();
@JsonFormat(pattern="dd/MM/yyyy HH:mm")
private LocalDateTime date;
I have no idea what I can do to fix this, I’m learning and I’d like to know how to fix it.
Could describe the situation better, your mapping seems to have more than one problem. If it is possible to include a class diagram
– Thiago Bomfim