KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > demo > drupal > persistence > Node


1 package demo.drupal.persistence;
2
3 import javax.persistence.Column;
4 import javax.persistence.Entity;
5 import javax.persistence.Id;
6 import javax.persistence.JoinColumn;
7 import javax.persistence.ManyToOne;
8 import javax.persistence.Table;
9 import java.sql.Date JavaDoc;
10
11 @Entity
12 @Table(name="node")
13 public class Node {
14   /**
15    * CREATE TABLE `node` (
16    * `nid` int(10) unsigned NOT NULL auto_increment,
17    * `vid` int(10) unsigned NOT NULL default '0',
18    * `type` varchar(32) NOT NULL default '',
19    * `title` varchar(128) NOT NULL default '',
20    * `uid` int(10) NOT NULL default '0',
21    * `status` int(4) NOT NULL default '1',
22    * `created` int(11) NOT NULL default '0',
23    * `changed` int(11) NOT NULL default '0',
24    * `comment` int(2) NOT NULL default '0',
25    * `promote` int(2) NOT NULL default '0',
26    * `moderate` int(2) NOT NULL default '0',
27    * `sticky` int(2) NOT NULL default '0',
28    * PRIMARY KEY (`nid`),
29    * KEY `node_type` (`type`(4)),
30    * KEY `node_title_type` (`title`,`type`(4)),
31    * KEY `status` (`status`),
32    * KEY `uid` (`uid`),
33    * KEY `vid` (`vid`),
34    * KEY `node_moderate` (`moderate`),
35    * KEY `node_promote_status` (`promote`,`status`),
36    * KEY `node_created` (`created`),
37    * KEY `node_changed` (`changed`),
38    * KEY `node_status_type` (`status`,`type`,`nid`)
39    *);
40    */

41
42   @Id
43   @Column(name="nid")
44   private int id;
45
46   private String JavaDoc type;
47   private String JavaDoc title;
48   private int status;
49   private Date JavaDoc created;
50   private Date JavaDoc changed;
51   private int comment;
52   private int promote;
53   private int moderate;
54   private int sticky;
55
56   @ManyToOne
57   @JoinColumn(name="uid")
58   private User user;
59
60   @ManyToOne
61   @JoinColumn(name="vid")
62   private Vocabulary vocabulary;
63
64   public int getId()
65   {
66     return id;
67   }
68
69   public Date JavaDoc getChanged()
70   {
71     return changed;
72   }
73
74   public int getComment()
75   {
76     return comment;
77   }
78
79   public Date JavaDoc getCreated()
80   {
81     return created;
82   }
83
84   public int getModerate()
85   {
86     return moderate;
87   }
88
89   public int getPromote()
90   {
91     return promote;
92   }
93
94   public int getStatus()
95   {
96     return status;
97   }
98
99   public int getSticky()
100   {
101     return sticky;
102   }
103
104   public String JavaDoc getTitle()
105   {
106     return title;
107   }
108
109   public String JavaDoc getType()
110   {
111     return type;
112   }
113
114   public User getUser()
115   {
116     return user;
117   }
118
119   public Vocabulary getVocabulary()
120   {
121     return vocabulary;
122   }
123 }
124
Popular Tags