1 7 package org.jboss.tutorial.blob.bean; 8 9 import java.io.Serializable ; 10 import javax.persistence.Entity; 11 import javax.persistence.Id; 12 import javax.persistence.GeneratorType; 13 import javax.persistence.Lob; 14 import javax.persistence.FetchType; 15 import javax.persistence.LobType; 16 17 22 @Entity 23 public class BlobEntity2 implements Serializable 24 { 25 private long id; 26 private byte[] blobby; 27 private String clobby; 28 29 @Id(generate = GeneratorType.AUTO) 30 public long getId() 31 { 32 return id; 33 } 34 35 public void setId(long id) 36 { 37 this.id = id; 38 } 39 40 @Lob(fetch = FetchType.EAGER) 41 public byte[] getBlobby() 42 { 43 return blobby; 44 } 45 46 public void setBlobby(byte[] blobby) 47 { 48 this.blobby = blobby; 49 } 50 51 @Lob(type = LobType.CLOB, fetch = FetchType.EAGER) 52 public String getClobby() 53 { 54 return clobby; 55 } 56 57 public void setClobby(String clobby) 58 { 59 this.clobby = clobby; 60 } 61 62 63 } 64 | Popular Tags |