This content has been marked as final. 
    
Show                 3 replies
    
- 
        
1. Re: Attach Entity
goku2 Sep 18, 2007 2:38 PM (in response to mcsous)Add the @Lob annotation
@Basic(fetch=FetchType.LAZY) @Column(updatable=false) @Lob private byte[] content;
 - 
        
2. Re: Attach Entity
mcsous Sep 18, 2007 6:16 PM (in response to mcsous)Ok, but if I add @Lob annotation in, Postgres Database, the column type will be wrong and won't save any file. The type column is oid and could be bytea.
 - 
        
3. Re: Attach Entity
goku2 Sep 18, 2007 7:37 PM (in response to mcsous)mcsous, if you specify
@Basic(fetch=FetchType.LAZY) @Column(updatable=false) @Lob private byte[] content;
In postgres (al least 8.2) it will map to a Oid column, not a blob.
Cheers