Red Hat Web Application Framework 6.1 Manual do Utilizador Página 144

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 230
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 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 página 143
1 2 ... 139 140 141 142 143 144 145 146 147 148 149 ... 229 230

Comentários a estes Manuais

Sem comentários