FileDocCategorySizeDatePackage
Product.javaAPI DocJBoss 4.2.13744Fri Jul 13 20:55:58 BST 2007xpetstore.domain.catalog.ejb

Product

public class Product extends Object
ejb.bean name="Product" type="CMP" view-type="local" primkey-field="productId" schema="Product" cmp-version="${ejb.cmp.version}"
ejb.value-object name="Product" match="*"
ejb.transaction type="Required"
ejb.persistence table-name="T_PRODUCT"
jboss.persistence create-table="${jboss.create.table}" remove-table="${jboss.remove.table}"

Fields Summary
private String
productId
private String
name
private String
description
private Collection
items
private Category
category
Constructors Summary
public Product()

      
   
public Product(String productId, String name, String description)

      this.productId = productId;
      this.name = name;
      this.description = description;
   
Methods Summary
public CategorygetCategory()

ejb.interface-method
ejb.relation name="category-products" role-name="product-belongs_to-category" cascade-delete="yes"
jboss.relation fk-column="category_fk" related-pk-field="categoryId" fk-contraint="${db.foreign.key}"
weblogic.column-map foreign-key-column="category_fk"

       return category;
    
public java.lang.StringgetDescription()

ejb.persistence column-name="description" jdbc-type="VARCHAR" sql-type="varchar(255)"

       return description;
    
public java.util.CollectiongetItems()

ejb.interface-method
ejb.relation name="product-items" role-name="product-has-items"

       return items;
    
public java.lang.StringgetName()

ejb.persistence column-name="name" jdbc-type="VARCHAR" sql-type="varchar(50)"

       return name;
    
public java.lang.StringgetProductId()

ejb.pk-field
ejb.persistence column-name="productId" jdbc-type="VARCHAR" sql-type="varchar(10)"
ejb.interface-method
ejb.transaction type="Supports"

       return productId;
    
public voidsetCategory(Category category)

       this.category = category;
    
public voidsetDescription(java.lang.String description)

       this.description = description;
    
public voidsetItems(java.util.Collection items)

       this.items = items;
    
public voidsetName(java.lang.String name)

       this.name = name;
    
public voidsetProductId(java.lang.String productId)

       this.productId = productId;
    
public java.lang.StringtoString()

       StringBuffer buffer = new StringBuffer(200);
       buffer.append("[Product: productId " + productId);
       buffer.append(", name " + name);
       buffer.append("]");
       
       return buffer.toString();