KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > tutorial > blob > bean > BlobEntity2


1 /*
2  * JBoss, the OpenSource J2EE webOS
3  *
4  * Distributable under LGPL license.
5  * See terms of license at gnu.org.
6  */

7 package org.jboss.tutorial.blob.bean;
8
9 import java.io.Serializable JavaDoc;
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 /**
18  * comment
19  *
20  * @author <a HREF="mailto:bill@jboss.org">Bill Burke</a>
21  */

22 @Entity
23 public class BlobEntity2 implements Serializable JavaDoc
24 {
25    private long id;
26    private byte[] blobby;
27    private String JavaDoc 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 JavaDoc getClobby()
53    {
54       return clobby;
55    }
56
57    public void setClobby(String JavaDoc clobby)
58    {
59       this.clobby = clobby;
60    }
61
62
63 }
64
Popular Tags