@Lob in JPA, Hibernate
http://www.java2s.com/Tutorials/Java/JPA/0250__JPA_Lob_Column.htm
The following code shows how to save byte array to database with @Lob annotation.
LOBs have two types in the database: character large objects, called CLOBs, and binary large objects, or BLOBs.
A CLOB column holds a large character sequence, and a BLOB column can store a large byte sequence.
The Java types mapped to BLOB columns are byte[] Byte[] , and Serializable types, while char[] Character[] , and String objects are mapped to CLOB columns.
The following code shows how to save byte array to database with @Lob annotation.
LOBs have two types in the database: character large objects, called CLOBs, and binary large objects, or BLOBs.
A CLOB column holds a large character sequence, and a BLOB column can store a large byte sequence.
The Java types mapped to BLOB columns are byte[] Byte[] , and Serializable types, while char[] Character[] , and String objects are mapped to CLOB columns.
@Lob
private byte[] picture; //BLOB
or @Lob
private Byte[] picture; //BLOB
@Lob private char[] picture; // CLOBor
@Lob
private Character[] picture; //CLOB
Comments
Post a Comment