KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > de > nava > informa > impl > hibernate > Image


1 //
2
// Informa -- RSS Library for Java
3
// Copyright (c) 2002 by Niko Schmuck
4
//
5
// Niko Schmuck
6
// http://sourceforge.net/projects/informa
7
// mailto:niko_schmuck@users.sourceforge.net
8
//
9
// This library is free software.
10
//
11
// You may redistribute it and/or modify it under the terms of the GNU
12
// Lesser General Public License as published by the Free Software Foundation.
13
//
14
// Version 2.1 of the license should be included with this distribution in
15
// the file LICENSE. If the license is not included with this distribution,
16
// you may find a copy at the FSF web site at 'www.gnu.org' or 'www.fsf.org',
17
// or you may write to the Free Software Foundation, 675 Mass Ave, Cambridge,
18
// MA 02139 USA.
19
//
20
// This library is distributed in the hope that it will be useful,
21
// but WITHOUT ANY WARRANTY; without even the implied waranty of
22
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23
// Lesser General Public License for more details.
24
//
25

26
27 // $Id: Image.java,v 1.4 2003/10/15 10:04:18 niko_schmuck Exp $
28

29 package de.nava.informa.impl.hibernate;
30
31 import java.net.URL JavaDoc;
32
33 import de.nava.informa.core.ImageIF;
34
35 /**
36  * Hibernate implementation of the ImageIF interface.
37  *
38  * @author Niko Schmuck (niko@nava.de)
39  *
40  * @hibernate.class
41  * table="IMAGES"
42  */

43 public class Image implements ImageIF, java.io.Serializable JavaDoc {
44
45   private int id;
46   private String JavaDoc title;
47   private String JavaDoc description;
48   private URL JavaDoc location;
49   private URL JavaDoc link;
50   private int width;
51   private int height;
52
53   public Image() {
54     this("Unnamed image", null, null);
55   }
56
57   public Image(String JavaDoc title, URL JavaDoc location, URL JavaDoc link) {
58     this.title = title;
59     this.location = location;
60     this.link = link;
61   }
62
63   /**
64    * @hibernate.id
65    * column="IMAGE_ID"
66    * generator-class="native"
67    * type="integer"
68    */

69   public int getIntId() {
70     return id;
71   }
72
73   public void setIntId(int id) {
74     this.id = id;
75   }
76
77   public long getId() {
78     return id;
79   }
80
81   public void setId(long longid) {
82     this.id = (int) longid;
83   }
84
85   // --------------------------------------------------------------
86
// implementation of ImageIF interface
87
// --------------------------------------------------------------
88

89   /**
90    * @hibernate.property
91    * column="TITLE"
92    * not-null="true"
93    */

94   public String JavaDoc getTitle() {
95     return title;
96   }
97
98   public void setTitle(String JavaDoc title) {
99     this.title = title;
100   }
101
102   /**
103    * @hibernate.property
104    * column="DESCRIPTION"
105    */

106   public String JavaDoc getDescription() {
107     return description;
108   }
109
110   public void setDescription(String JavaDoc description) {
111     this.description = description;
112   }
113
114   /**
115    * @hibernate.property
116    * column="LOCATION"
117    */

118   public URL JavaDoc getLocation() {
119     return location;
120   }
121
122   public void setLocation(URL JavaDoc location) {
123     this.location = location;
124   }
125
126   /**
127    * @hibernate.property
128    * column="LINK"
129    */

130   public URL JavaDoc getLink() {
131     return link;
132   }
133
134   public void setLink(URL JavaDoc link) {
135     this.link = link;
136   }
137
138   /**
139    * @hibernate.property
140    * column="WIDTH"
141    */

142   public int getWidth() {
143     return width;
144   }
145
146   public void setWidth(int width) {
147     this.width = width;
148   }
149
150   /**
151    * @hibernate.property
152    * column="HEIGHT"
153    */

154   public int getHeight() {
155     return height;
156   }
157
158   public void setHeight(int height) {
159     this.height = height;
160   }
161
162 }
163
Popular Tags