KickJava   Java API By Example, From Geeks To Geeks.

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


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="vocabulary")
9 public class Vocabulary {
10   /**
11    * CREATE TABLE `vocabulary` (
12    * `vid` int(10) unsigned NOT NULL auto_increment,
13    * `name` varchar(255) NOT NULL default '',
14    * `description` longtext,
15    * `help` varchar(255) NOT NULL default '',
16    * `relations` tinyint(3) unsigned NOT NULL default '0',
17    * `hierarchy` tinyint(3) unsigned NOT NULL default '0',
18    * `multiple` tinyint(3) unsigned NOT NULL default '0',
19    * `required` tinyint(3) unsigned NOT NULL default '0',
20    * `tags` tinyint(3) unsigned NOT NULL default '0',
21    * `module` varchar(255) NOT NULL default '',
22    * `weight` tinyint(4) NOT NULL default '0',
23    * PRIMARY KEY (`vid`)
24    * );
25    */

26
27   @Id
28   private int vid;
29   private String JavaDoc name;
30   private String JavaDoc description;
31   private String JavaDoc help;
32   private int relations;
33   private int hierarchy;
34   private int multiple;
35   private int required;
36   private int tags;
37   private String JavaDoc module;
38   private int weight;
39   
40   public String JavaDoc toString()
41   {
42     return getClass().getSimpleName() + "[" + vid + "," + name + "]";
43   }
44 }
45
46 /**
47 DROP TABLE IF EXISTS `vocabulary_node_types`;
48 CREATE TABLE `vocabulary_node_types` (
49   `vid` int(10) unsigned NOT NULL default '0',
50   `type` varchar(16) NOT NULL default '',
51   PRIMARY KEY (`vid`,`type`)
52 );
53 */

54
55
Popular Tags