M
M
Maks Burkov2017-03-31 17:55:06
Java
Maks Burkov, 2017-03-31 17:55:06

How to configure Hibernate to correctly create a type in a table?

A BIGINT FK Coupon_Title is created in the company_coupons table on Coupon , THEN HOW a VARCHAR Coupon_Title is created in the Coupons table
.

@OneToMany
    @JoinTable(name = "company_coupons" , joinColumns = @JoinColumn(name = "COMPANY_ID") , inverseJoinColumns = {@JoinColumn(name = "COUPON_ID"), @JoinColumn(name = "COUPON_TITLE")})
    private Collection<Coupon> company_coupons;

cf7ad1b218ac41f1b5c9ab27e110d829.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Eugene Khrustalev, 2017-03-31
@eugenehr

Show class Coupon

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question