/**
 * Copyright (c) 2004 Red Hat, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
 * USA
 *
 * Component of: Red Hat Application Server
 * 
 * Initial Developers: Aizaz Ahmed
 *                     Vivek Lakshmanan
 *                     Andrew Overholt
 *                     Matthew Wringe
 *
 */

/*
 * PropertyBean.java
 * 
 * Created on Aug 13, 2004
 *
 */
package olstore.entity;

import javax.ejb.EntityBean;

/**
 * @ejb.bean name="Property"
 *  description="This bean is used to store extra information about items."
 *	type="CMP"
 *  schema="olstore_properties"
 *  reentrant="false"
 *  cmp-version="2.x"
 *  view-type="local"
 *  local-jndi-name="PropertyLocal_L"
 *
 * @ejb.relation
 *  name="Item-Property"
 *  role-name="Property-belongs-to-Item"
 *  cascade-delete="yes"
 *  target-ejb="Item"
 *  target-multiple="yes"
 * 
 * @ejb.relation
 *  name="Type-Property"
 *  role-name="Property-belongs-to-Type"
 *  cascade-delete="yes"
 *  target-ejb="Type"
 *  target-multiple="yes"
 *
 * @ejb.transaction
 *  type="Required"
 *
 * @ejb:pk
 *  class="java.lang.Object"
 *  generate="false"
 *
 * --
 * This is needed for JOnAS.
 * If you are not using JOnAS you can safely remove the tags below.
 * @jonas.bean ejb-name="Property"
 * jndi-name="PropertyLocal"
 * @jonas.jdbc-mapping  jndi-name="jdbc_1" jdbc-table-name="olstore_properties" 
 * --
 * 
 *  @ejb.persistence
 * 
 * @ejb.finder 
 *    query="SELECT OBJECT(a) FROM olstore_properties as a"  
 *    signature="java.util.Collection findAll()"  
 * 
 * @ejb.finder 
 *    query="SELECT OBJECT(a) FROM olstore_properties as a WHERE a.name = ?1"  
 *    signature="java.util.Collection findByName(java.lang.String name)" 
 * 
 *--
 * This is needed for JOnAS.
 * If you are not using JOnAS you can safely remove the tags below.
 * @jonas.finder-method-jdbc-mapping  method-name="findAll"
 *	jdbc-where-clause=""
 * @jonas.jdbc-mapping  jndi-name="jdbc_1"
 *	jdbc-table-name="olstore_properties"
 * 
 *--
 *  
 **/

public abstract class PropertyBean implements EntityBean {
    
    /**
     * The  ejbCreate method.
     * 
     * @ejb.create-method 
     */
    public java.lang.String ejbCreate(String name, String value)
    throws javax.ejb.CreateException {
        setName(name);
        setValue(value);
        return null;
    }
    
    /**
     * The container invokes this method immediately after it calls ejbCreate.
     * 
     */
    public void ejbPostCreate(String name, String value) throws javax.ejb.CreateException {
    }
    
    /**
     * Returns the name
     * @return the name
     * 
     * @ejb.persistent-field 
     * @ejb.persistence
     *    column-name="name"
     *     sql-type="VARCHAR"
     *  
     * @ejb.interface-method
     * 
     */
    public abstract java.lang.String getName();
    
    /**
     * Sets the name
     * 
     * @param java.lang.String the new name value
     * 
     * @ejb.interface-method
     */
    public abstract void setName(java.lang.String name);
    
    /**
     * Returns the value
     * @return the value
     * 
     * @ejb.persistent-field 
     * @ejb.persistence
     *    column-name="value"
     *     sql-type="VARCHAR"
     *  
     * @ejb.interface-method
     * 
     */
    public abstract java.lang.String getValue();
    
    /**
     * Sets the value
     * 
     * @param java.lang.String the new value
     * 
     * @ejb.interface-method
     */
    public abstract void setValue(java.lang.String value);
    
}
