Good day. The problem is the following: there are three hibernate entities: customer, order, photo. The customer has orders and there is one photo. The photo consists of long id, byte [] data (mediumblob), Customer customer. Everything is working. It is necessary now to add another score to the order (long id, byte [] data (mediumblob), Ord ord) - i.e. the same as the photo. But, as soon as I add this entity, the order table ceases to be created and "ERROR". What is wrong? Thank. Update: an error occurs only if you add a link between the order and the invoice, therefore I clarify the question. Is there a limit on the number of columns (the order has 8 columns without this entity) or on the number of additional tables?
@Entity @Table(name = "Orders") public class Ord { @Id @Expose @GeneratedValue(strategy = GenerationType.AUTO) private long id; @Expose @ManyToOne(cascade = CascadeType.ALL) @JoinColumn(name = "product") private Product product; @Expose @Column(nullable = false) private String buyer; @Expose private long orderTime; @Expose private long deliveryTime; @Expose @ManyToOne @JoinColumn(name = "customer") private Customer customer; @Expose @JoinColumn(name = "category") @ManyToOne private Category category; @Expose private boolean status; @JoinColumn(name = "check") @OneToOne(fetch = FetchType.EAGER,cascade = CascadeType.ALL) private Check check; @Entity @Table(name = "checks") public class Check { @Id @Expose @GeneratedValue private long id; @Expose(serialize = false) @Column(columnDefinition = "MEDIUMBLOB") private byte[]data; @Expose(serialize = false) @OneToOne(mappedBy = "check") private Ord order; @Entity @Table(name = "photos") public class Photo { @Id @GeneratedValue @Expose private long id; @Expose(serialize = false) @Column(columnDefinition="mediumblob") private byte[]data; @Expose(serialize = false) @OneToOne(mappedBy = "photo") private Customer customer;
orderreserved word in the database, tryorder1to make and write here - MrFylypenko