'Will `@JoinColumn` inherit `columnDefinition` by default?
I would like to have explicit column format for some key
@Entity
@Table(...)
public class MyClass1 {
@Id
@Column(columnDefinition = "int(10) unsigned")
private Long id;
...
}
Should I also specify it explicitly in related class
@Entity
@Table(...)
public class MyClass2 {
@ManyToOne
@JoinColumn(name="my_id", columnDefinition = "int(10) unsigned")
private MyClass1 myClass1;
...
}
or it will work automatically if omitted?
@Entity
@Table(...)
public class MyClass2 {
@ManyToOne
@JoinColumn(name="my_id")
private MyClass1 myClass1;
...
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
