增加@ElementCollection中元素的大小

Alb*_*spo 3 java mysql hibernate jpa h2

我有一个@EntityJPA,有@ElementCollection这样的:

@ElementCollection(fetch=FetchType.EAGER)
List<String> photodescription = new ArrayList<>();
Run Code Online (Sandbox Code Playgroud)

问题是默认情况下,any的列photodescription是a VARCHAR(255).我需要将其增加到10000.

是否存在a中元素的任何anotation,@ElementCollection以设置最大大小,如@Size(max=1000)用于简单的String?

Dav*_*Yee 8

@Column注释应该还是能在这个集合的字符串工作:

@ElementCollection(fetch=FetchType.EAGER)
@Column(length=10000) // OR @Column(columnDefinition="VARCHAR(10000)")
List<String> photodescription = new ArrayList<>();
Run Code Online (Sandbox Code Playgroud)