[英]Does JPA @ElementCollection annotation always produce an one-to-many relationship?
For this question, consider the following sample: 对于此问题,请考虑以下示例:
@Entity
public class File {
public static enum Permission { READABLE, WRITEABLE, EXECUTABLE }
@ElementCollection
@Enumerated(EnumType.ORDINAL)
Set<Permission> permissions;
// Omitted
}
Assuming that the enum values are stored in the ordinal form, does JPA always create an extra table for this set? 假设枚举值以序数形式存储,JPA是否总是为此集合创建一个额外的表? Can I alter this in order to make this not to be an one-to-many relationship, ie, using a column instead of an extra table?
我是否可以更改它以使其不成为一对多关系,即使用列而不是额外的表?
Thanks. 谢谢。
private String permissions;
private String permissions;
.
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.