001: /*
002: * Created on 27 mai 2004
003: *
004: * To change the template for this generated file go to
005: * Window - Preferences - Java - Code Generation - Code and Comments
006: */
007: package org.objectweb.speedo.pobjects.inheritance.ejboo2;
008:
009: import java.util.Collection;
010: import java.util.HashSet;
011:
012: import javax.jdo.JDOHelper;
013: import javax.jdo.PersistenceManager;
014:
015: /**
016: * Persistent Data
017: */
018: public class MarchePersistantImpl implements MarchePersistant {
019:
020: private Long id;
021:
022: private String nom;
023:
024: private String description;
025:
026: /**
027: * Constructor
028: * @param id
029: */
030: public MarchePersistantImpl() {
031: this .articles = new HashSet();
032: }
033:
034: public MarchePersistantImpl(long idmar) {
035: this ();
036: id = new Long(idmar);
037: }
038:
039: // many many relation, reverse = marches
040: private Collection articles;
041:
042: /**
043: * @return Returns the articles.
044: */
045: public Collection getArticles() {
046: return articles;
047: }
048:
049: /**
050: * @param articles The articles to set.
051: */
052: public void setArticles(Collection articles) {
053: this .articles = articles;
054: }
055:
056: /**
057: * @return Returns the description.
058: */
059: public String getDescription() {
060: return description;
061: }
062:
063: /**
064: * @param description The description to set.
065: */
066: public void setDescription(String description) {
067: this .description = description;
068: }
069:
070: /**
071: * @return Returns the id.
072: */
073: public Long getId() {
074: return id;
075: }
076:
077: /**
078: * @param id The id to set.
079: */
080: public void setId(Long id) {
081: this .id = id;
082: }
083:
084: /**
085: * @return Returns the nom.
086: */
087: public String getNom() {
088: return nom;
089: }
090:
091: /**
092: * @param nom The nom to set.
093: */
094: public void setNom(String nom) {
095: this .nom = nom;
096: }
097:
098: public void supprimer() {
099: PersistenceManager pm = JDOHelper.getPersistenceManager(this );
100:
101: pm.deletePersistent(this );
102: }
103:
104: public String toString() {
105: String s = new String(this .getClass().getName());
106: s += " id=" + id;
107: s += " nom=" + nom;
108: s += " description=" + description;
109: return s;
110: }
111: }
|