1 7 package org.objectweb.speedo.pobjects.inheritance.ejboo2; 8 9 import java.util.Collection ; 10 import java.util.Date ; 11 import java.util.HashSet ; 12 import java.util.Iterator ; 13 14 import javax.jdo.InstanceCallbacks; 15 import javax.jdo.JDOHelper; 16 import javax.jdo.PersistenceManager; 17 18 19 22 23 public abstract class ArticlePersistantImpl 24 implements ArticlePersistant, InstanceCallbacks { 25 26 private Long id; 27 28 private String nom; 29 30 private String description; 31 32 35 private String type; 36 37 40 private Date dateCom; 41 42 45 private CataloguePersistantImpl catalogue; 47 48 51 private Collection marches; 52 53 54 55 public ArticlePersistantImpl() { 56 marches = new HashSet (); 57 } 58 59 public ArticlePersistantImpl(String _type) { 60 this(); 61 this.type = _type; 62 } 63 64 public ArticlePersistantImpl(String _type, long idart) { 65 this(_type); 66 this.id = new Long (idart); 67 } 68 69 72 public CataloguePersistant getCatalogue() { 73 return catalogue; 74 } 75 78 public void setCatalogue(CataloguePersistant catalogue) { 79 this.catalogue = (CataloguePersistantImpl)catalogue; 80 } 81 84 public Date getDateCom() { 85 return dateCom; 86 } 87 90 public void setDateCom(Date dateCom) { 91 this.dateCom = dateCom; 92 } 93 96 public String getDescription() { 97 return description; 98 } 99 102 public void setDescription(String description) { 103 this.description = description; 104 } 105 108 public Long getId() { 109 return id; 110 } 111 114 public void setId(Long id) { 115 this.id = id; 116 } 117 120 public Collection getMarches() { 121 return marches; 122 } 123 126 public void setMarches(Collection marches) { 127 this.marches = marches; 128 } 129 132 public String getNom() { 133 return nom; 134 } 135 138 public void setNom(String nom) { 139 this.nom = nom; 140 } 141 144 public String getType() { 145 return type; 146 } 147 150 public void setType(String type) { 151 this.type = type; 152 } 153 154 public void supprimer() { 155 System.out.println("ArticlePersistantImpl.supprimer"); 156 PersistenceManager pm = JDOHelper.getPersistenceManager(this); 157 158 System.out.println("pm.deletePersistent(this)"); 159 pm.deletePersistent(this); 160 } 161 162 public void jdoPreDelete() { 163 PersistenceManager pm = JDOHelper.getPersistenceManager(this); 165 166 catalogue = null; 168 169 for (Iterator i = marches.iterator(); i.hasNext();) { 171 ((MarchePersistant) i.next()).getArticles().remove(this); 172 } 173 174 marches.clear(); 176 } 177 178 public void jdoPreStore() { 179 180 } 181 public void jdoPreClear() { 182 183 } 184 public void jdoPostLoad() { 185 186 } 187 188 public String toString() { 189 String s = new String (this.getClass().getName()); 190 s += " id="+id; 191 s += " nom="+nom; 192 s += " description="+description; 193 s += " type="+type; 194 return s; 195 } 196 } 197 | Popular Tags |