在jpa实体中指定lob大小

U-L*_*U-L 8 jpa blob

我使用openjpa(Websphere Application Server 7)与数据库进行交互.是否可以在java实体文件中指定blob大小?看起来像:

@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;

@Lob
@Nullable
private byte[] content;
Run Code Online (Sandbox Code Playgroud)

DB2默认情况下为它提供1MB的大小.我想将其更改为20MB.

Pet*_*zki 10

您可以使用@Column注释:

@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;

@Lob
@Nullable
@Column(length = 20971520)
private byte[] content;
Run Code Online (Sandbox Code Playgroud)