KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > speedo > pobjects > inheritance > ejboo2 > MarchePersistantImpl


1 /*
2  * Created on 27 mai 2004
3  *
4  * To change the template for this generated file go to
5  * Window - Preferences - Java - Code Generation - Code and Comments
6  */

7 package org.objectweb.speedo.pobjects.inheritance.ejboo2;
8
9 import java.util.Collection JavaDoc;
10 import java.util.HashSet JavaDoc;
11
12 import javax.jdo.JDOHelper;
13 import javax.jdo.PersistenceManager;
14
15 /**
16  * Persistent Data
17  */

18 public class MarchePersistantImpl implements MarchePersistant {
19     
20     private Long JavaDoc id;
21
22     private String JavaDoc nom;
23
24     private String JavaDoc description;
25     
26     /**
27      * Constructor
28      * @param id
29      */

30     public MarchePersistantImpl() {
31         this.articles = new HashSet JavaDoc();
32     }
33     
34     public MarchePersistantImpl(long idmar) {
35         this();
36         id = new Long JavaDoc(idmar);
37     }
38     
39
40     // many many relation, reverse = marches
41
private Collection JavaDoc articles;
42     /**
43      * @return Returns the articles.
44      */

45     public Collection JavaDoc getArticles() {
46         return articles;
47     }
48     /**
49      * @param articles The articles to set.
50      */

51     public void setArticles(Collection JavaDoc articles) {
52         this.articles = articles;
53     }
54     /**
55      * @return Returns the description.
56      */

57     public String JavaDoc getDescription() {
58         return description;
59     }
60     /**
61      * @param description The description to set.
62      */

63     public void setDescription(String JavaDoc description) {
64         this.description = description;
65     }
66     /**
67      * @return Returns the id.
68      */

69     public Long JavaDoc getId() {
70         return id;
71     }
72     /**
73      * @param id The id to set.
74      */

75     public void setId(Long JavaDoc id) {
76         this.id = id;
77     }
78     /**
79      * @return Returns the nom.
80      */

81     public String JavaDoc getNom() {
82         return nom;
83     }
84     /**
85      * @param nom The nom to set.
86      */

87     public void setNom(String JavaDoc nom) {
88         this.nom = nom;
89     }
90
91     public void supprimer() {
92         PersistenceManager pm = JDOHelper.getPersistenceManager(this);
93         
94         pm.deletePersistent(this);
95     }
96
97     public String JavaDoc toString() {
98         String JavaDoc s = new String JavaDoc(this.getClass().getName());
99         s += " id="+id;
100         s += " nom="+nom;
101         s += " description="+description;
102         return s;
103     }
104 }
105
Popular Tags