Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 openjpa (Websphere Application Server 7) 与数据库进行交互。是否可以在 java 实体文件中指定 blob 大小?看起来像:
@Id @GeneratedValue(strategy = GenerationType.AUTO) private Long id; @Lob @Nullable private byte[] content;
默认情况下,DB2 给它的大小为 1MB。我想将其更改为 20MB。
您可以使用@Column注释:
@Column
@Id @GeneratedValue(strategy = GenerationType.AUTO) private Long id; @Lob @Nullable @Column(length = 20971520) private byte[] content;