I've got a table with the following structure:
int id | blob file_to_store | int version
This is how my domain works:
@Entity
@Table(name = "FileToStore")
public class FileToStore{
@Id
@Column(name = "id")
private int Id;
@Column(name = "version")
private int version;
@Column(name = "file_to_store")
@Lob
private Blob file;
//gets and sets
}
Sometimes I just need a file version. Like this :
FileToStore fileToStore=FileToStoreService.get(id);
return fileToStore.getVersion();
Is that going to work fast or I have to write another SQL query to take version field only to avoid loading file? Oracle documentation says
Blob object contains a logical pointer to the SQL BLOB data rather than the data itself