KickJava   Java API By Example, From Geeks To Geeks.

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


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: ItemSource.java,v 1.3 2003/10/15 10:04:19 niko_schmuck Exp $
28

29 package de.nava.informa.impl.hibernate;
30
31 import java.util.Date JavaDoc;
32 import de.nava.informa.core.ItemIF;
33 import de.nava.informa.core.ItemSourceIF;
34
35 /**
36  * Hibernate implementation of the ItemSourceIF interface.
37  *
38  * @author Michael Harhen
39  *
40  * @hibernate.class
41  * table="ITEM_SOURCE"
42  */

43 public class ItemSource implements ItemSourceIF, java.io.Serializable JavaDoc {
44
45   private int id;
46   private ItemIF item;
47   private String JavaDoc name;
48   private String JavaDoc location;
49   private Date JavaDoc timestamp;
50
51   public ItemSource() {
52     this(null);
53   }
54
55   /**
56    * Default constructor.
57    */

58   public ItemSource(ItemIF item) {
59     this(item, null, null, null);
60   }
61
62   public ItemSource(ItemIF item, String JavaDoc name, String JavaDoc location, Date JavaDoc timestamp) {
63     this.item = item;
64     this.name = name;
65     this.location = location;
66     this.timestamp = timestamp;
67   }
68
69   /**
70    * @hibernate.id
71    * generator-class="native"
72    * column="ITEM_SOURCE_ID"
73    * type="integer"
74    */

75   public int getIntId() {
76     return id;
77   }
78
79   public void setIntId(int id) {
80     this.id = id;
81   }
82
83   public long getId() {
84     return id;
85   }
86
87   public void setId(long longid) {
88     this.id = (int) longid;
89   }
90
91   // --------------------------------------------------------------
92
// implementation of ItemSourceIF interface
93
// --------------------------------------------------------------
94

95   /**
96    * @hibernate.many-to-one
97    * column="ITEM_ID"
98    * class="de.nava.informa.impl.hibernate.Item"
99    * not-null="true"
100    */

101   public ItemIF getItem() {
102     return item;
103   }
104
105   public void setItem(ItemIF item) {
106     this.item = item;
107   }
108
109   /**
110    * @hibernate.property
111    * column="NAME"
112    */

113   public String JavaDoc getName() {
114     return name;
115   }
116
117   public void setName(String JavaDoc name) {
118     this.name = name;
119   }
120
121   /**
122    * @hibernate.property
123    * column="LOCATION"
124    */

125   public String JavaDoc getLocation() {
126     return location;
127   }
128
129   public void setLocation(String JavaDoc location) {
130     this.location = location;
131   }
132
133   /**
134    * @hibernate.property
135    * column="TIMESTAMP"
136    */

137   public Date JavaDoc getTimestamp() {
138     return timestamp;
139   }
140
141   public void setTimestamp(Date JavaDoc timestamp) {
142     this.timestamp = timestamp;
143   }
144
145 }
146
Popular Tags