增加 @ElementCollection 中元素的大小
Increase the size of elements in a @ElementCollection
我在 JPA 中有一个 @Entity
,它有一个像这样的 @ElementCollection
:
@ElementCollection(fetch=FetchType.EAGER)
List<String> photodescription = new ArrayList<>();
问题是默认情况下,任何 photodescription
的列都是 VARCHAR(255)
。
我需要将其增加到 10000。
是否存在对来自 @ElementCollection
的元素的任何注释以设置最大大小,例如用于简单字符串的 @Size(max=1000)
?
@Column
注释应该仍然适用于这个字符串集合:
@ElementCollection(fetch=FetchType.EAGER)
@Column(length=10000) // OR @Column(columnDefinition="VARCHAR(10000)")
List<String> photodescription = new ArrayList<>();
我在 JPA 中有一个 @Entity
,它有一个像这样的 @ElementCollection
:
@ElementCollection(fetch=FetchType.EAGER)
List<String> photodescription = new ArrayList<>();
问题是默认情况下,任何 photodescription
的列都是 VARCHAR(255)
。
我需要将其增加到 10000。
是否存在对来自 @ElementCollection
的元素的任何注释以设置最大大小,例如用于简单字符串的 @Size(max=1000)
?
@Column
注释应该仍然适用于这个字符串集合:
@ElementCollection(fetch=FetchType.EAGER)
@Column(length=10000) // OR @Column(columnDefinition="VARCHAR(10000)")
List<String> photodescription = new ArrayList<>();