2
I have a project using Spring Boot to serve JSON on a Webservice. An error occurred when adding the Repository class. If you remove it the program starts normally (no errors in the console, I don’t mean features).
The mistake is: http://www.cjoint.com/c/FGir7xhZgvR (I put it on Cjoint because it’s too big).
Classes are:
@RepositoryRestResource
public interface Sells extends PagingAndSortingRepository<Long, Sell> {
}
@Entity
public class Sell implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private Date sellDate;
@OneToMany(mappedBy = "sell", targetEntity = SellItem.class,
fetch = FetchType.EAGER, cascade = CascadeType.ALL)
private List<SellItem> sellItems;
private Double total;
// Getters e setter omitidos
}
@Entity
public class SellItem implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@ManyToOne
private Product product;
private Integer quantity;
@ManyToOne
@JoinColumn(name = "sell_id")
private Sell sell;
//Getters e setter omitidos
}
If necessary, ask for more information in the comments.