在jpa实体中指定lob大小

时间:2012-05-24 17:37:44

标签: jpa blob

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

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

@Lob
@Nullable
private byte[] content;

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

1 个答案:

答案 0 :(得分:10)

您可以使用@Column注释:

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

@Lob
@Nullable
@Column(length = 20971520)
private byte[] content;