KickJava   Java API By Example, From Geeks To Geeks.

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


1 package demo.drupal.persistence;
2
3 import javax.persistence.Id;
4 import javax.persistence.Entity;
5 import javax.persistence.Table;
6
7 @Entity
8 @Table(name="users")
9 public class User {
10   /**
11    * CREATE TABLE `users` (
12    * `uid` int(10) unsigned NOT NULL default '0',
13    * `name` varchar(60) NOT NULL default '',
14    * `pass` varchar(32) NOT NULL default '',
15    * `mail` varchar(64) default '',
16    * `mode` tinyint(1) NOT NULL default '0',
17    * `sort` tinyint(1) default '0',
18    * `threshold` tinyint(1) default '0',
19    * `theme` varchar(255) NOT NULL default '',
20    * `signature` varchar(255) NOT NULL default '',
21    * `created` int(11) NOT NULL default '0',
22    * `access` int(11) NOT NULL default '0',
23    * `login` int(11) NOT NULL default '0',
24    * `status` tinyint(4) NOT NULL default '0',
25    * `timezone` varchar(8) default NULL,
26    * `language` varchar(12) NOT NULL default '',
27    * `picture` varchar(255) NOT NULL default '',
28    * `init` varchar(64) default '',
29    * `data` longtext,
30    * PRIMARY KEY (`uid`),
31    * UNIQUE KEY `name` (`name`),
32    * KEY `access` (`access`)
33    * );
34    */

35
36   @Id
37   private int uid;
38   private String JavaDoc name;
39   private String JavaDoc pass;
40   private String JavaDoc mail;
41   private int mode;
42   private int sort;
43   private int threshold;
44   private String JavaDoc theme;
45   private String JavaDoc signature;
46   private int created;
47   private int access;
48   private int login;
49   private int status;
50   private String JavaDoc timezone;
51   private String JavaDoc language;
52   private String JavaDoc picture;
53   private String JavaDoc init;
54   private String JavaDoc data;
55
56   public String JavaDoc toString()
57   {
58     return getClass().getSimpleName() + "[" + uid + "," + name + "]";
59   }
60 }
61
62 /**
63 DROP TABLE IF EXISTS `users_roles`;
64 CREATE TABLE `users_roles` (
65   `uid` int(10) unsigned NOT NULL default '0',
66   `rid` int(10) unsigned NOT NULL default '0',
67   PRIMARY KEY (`uid`,`rid`)
68 );
69 */

70
Popular Tags