Red Hat Web Application Framework 6.1 Manuel d'utilisateur Page 144

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 230
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 143
130 Chapter 11. Services Tutorials
Category b = new Category(new OID(124));
Category c = new Category(new OID(125));
if ( a != null && b != null && c != null ) {
// Makes Category B the parent of Category A
b.addChild(a);
// Makes Category C the parent of Category A
c.addChild(a);
// Sets Category B as the default parent of Category A
a.setDefaultParentCategory(b);
}
Example 11-3. Adding more parent categories
Figure 11-6. Category hierarchy before and after adding parent categories.
11.2.4. Removing Parent Categories
// Fetch category A from the database.
Category a = new Category(new OID(123));
// Fetch the parent category
Category b = a.getDefaultParentCategory();
b.removeChild(a);
a.setDefaultParentCategory(b.getDefaultParentCategory());
Example 11-4. Removing Parent Categories
Vue de la page 143
1 2 ... 139 140 141 142 143 144 145 146 147 148 149 ... 229 230

Commentaires sur ces manuels

Pas de commentaire