KickJava   Java API By Example, From Geeks To Geeks.

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


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

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

42 public class ItemMetadata implements ItemMetadataIF, java.io.Serializable JavaDoc {
43
44   private int id;
45   private ItemIF item;
46   private boolean markedRead;
47   private int score;
48
49   public ItemMetadata() {
50     this(null);
51   }
52
53   /**
54    * Default constructor which sets this metadata to unread and to
55    * the default score (see
56    * {@link de.nava.informa.core.ItemMetadataIF#DEFAULT_SCORE}).
57    */

58   public ItemMetadata(ItemIF item) {
59     this.item = item;
60     this.markedRead = false;
61     this.score = DEFAULT_SCORE;
62   }
63   
64   /**
65    * @hibernate.id
66    * column="ITEM_METADATA_ID"
67    * generator-class="native"
68    * type="integer"
69    */

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

90   /**
91    * @hibernate.many-to-one
92    * column="ITEM_ID"
93    * class="de.nava.informa.impl.hibernate.Item"
94    * not-null="true"
95    */

96   public ItemIF getItem() {
97     return item;
98   }
99
100   public void setItem(ItemIF item) {
101     this.item = item;
102   }
103
104   /**
105    * @hibernate.property
106    * column="MARKED_READ"
107    */

108   public boolean isMarkedRead() {
109     return markedRead;
110   }
111
112   public void setMarkedRead(boolean markedRead) {
113     this.markedRead = markedRead;
114   }
115  
116   /**
117    * @hibernate.property
118    * column="SCORE"
119    */

120   public int getScore() {
121     return score;
122   }
123
124   public void setScore(int score) {
125     this.score = score;
126   }
127   
128 }
129
Popular Tags