Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

specify lob size in jpa entity

Tags:

jpa

blob

I am using openjpa (Websphere Application Server 7) to interact with the database. Is it possible to specify a blob size in the java entity file? It looks like:

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

@Lob
@Nullable
private byte[] content;

DB2 by defaults gives it a size of 1MB. I want to change that to 20MB.

like image 737
U-L Avatar asked May 24 '12 17:05

U-L


1 Answers

You can use the @Column annotation:

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

@Lob
@Nullable
@Column(length = 20971520)
private byte[] content;
like image 130
Peter Bagyinszki Avatar answered Oct 05 '22 21:10

Peter Bagyinszki