Red Hat Web Application Framework 6.1 Manual de usuario Pagina 144

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 230
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 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
Vista de pagina 143
1 2 ... 139 140 141 142 143 144 145 146 147 148 149 ... 229 230

Comentarios a estos manuales

Sin comentarios