sdespolit
sdespolit

Reputation: 913

How to limit the column length while using collection of primitive type?

@ElementCollection
@CollectionTable(name = "db_foo")
public List<String> foo;

i want to add limitation on foo elements length (something like @Column(length=x)). Is it possible?

Upvotes: 0

Views: 557

Answers (1)

axtavt
axtavt

Reputation: 242726

Have you tried @Column(length=x)? As far as I understand, it should work in this case as well.

Upvotes: 2

Related Questions