Hello,
I crawled hours now through the net searching a solution, so I finally ask you my question:
I've got a class
files which contains a
clob. Well it's a clob and clobs are used for large data, so I don't want to load it right with the files, if I'll only get an overview of them.
Code:
@Entity
@Table(name = "FILES")
public class File implements Serializable {
@Id
@Column(name = "ID")
private int id;
@Lob
@Column(name = "DATA")
@Basic(fetch = FetchType.LAZY)
private char[] data;
// ...
// getter and setter
// ...
}
Usually, i'd expect from Hibernate, that it will load the clob, when I first access it.
Selecting a Lob with JDBC, you also only get a reference, from which you can load the data with a stream.
But with some reason, this doesn't work directl with Hibernate, as I had to read.
In the documentation I read something of a "Bytecode Instrumentation".
Sadly I don't have a clue what this is.. so what it es, why it is needed, nor a tutorial or example how it's inserted.
I have to add that i work with Eclipse.
So i would really really be happy, if someone could tell me how the thing works :).
I don't get a point to start with.
Thanks in advance!