Spring 图像存储弹簧数据+;SQLite数据库
我想使用Spring数据实体和Spring数据Rest(使用@RepositoryRestResource注释存储库)在SQLite数据库中存储一个图像blob 我的方言:Spring 图像存储弹簧数据+;SQLite数据库,spring,spring-boot,spring-data-jpa,Spring,Spring Boot,Spring Data Jpa,我想使用Spring数据实体和Spring数据Rest(使用@RepositoryRestResource注释存储库)在SQLite数据库中存储一个图像blob 我的方言: public SQLiteDialect() { ...... registerColumnType(Types.DATE, "date"); registerColumnType(Types.TIME, "time"); registerColumnType(Types.TIMESTAMP,
public SQLiteDialect() {
......
registerColumnType(Types.DATE, "date");
registerColumnType(Types.TIME, "time");
registerColumnType(Types.TIMESTAMP, "timestamp");
registerColumnType(Types.BINARY, "blob");
registerColumnType(Types.VARBINARY, "blob");
registerColumnType(Types.LONGVARBINARY, "blob");
// registerColumnType(Types.NULL, "null");
registerColumnType(Types.BLOB, "blob");
registerColumnType(Types.CLOB, "clob");
registerColumnType(Types.BOOLEAN, "integer");
。。。。。
在我的实体中,我有一个字段图像:
@Lob
@Size(max = 2000000000)
private byte[] image;
我通过使用base64编码的图像作为字符串持久化来解决这个问题