/**
 * 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
 *
 */

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

import javax.ejb.EntityBean;

/**
 * @ejb.bean name="Type"
 *  description="Each Item bean is of a certain Type."
 *	type="CMP"
 *  primkey-field="name"
 *  schema="olstore_type"
 *  reentrant="false"
 *  cmp-version="2.x"
 *  view-type="local"
 *  local-jndi-name="TypeLocal_L"
 * 
 * @ejb.relation
 *  name="Item-Type"
 *  target-ejb="Item"
 *  role-name="Type-has-many-Items"
 * 
 * @ejb.transaction
 *  type="Required"
 * 
 *--
 * This is needed for JOnAS.
 * If you are not using JOnAS you can safely remove the tags below.
 * @jonas.bean ejb-name="Type"
 * jndi-name="TypeLocal"
 * @jonas.jdbc-mapping  jndi-name="jdbc_1" jdbc-table-name="olstore_type" 
 * --
 * 
 *  @ejb.persistence
 * 
 * @ejb.finder 
 *    query="SELECT OBJECT(a) FROM olstore_type as a"  
 *    signature="java.util.Collection findAll()"  
 * 
 * @ejb.finder 
 *    query="SELECT OBJECT(a) FROM olstore_type as a WHERE a.name = ?1"  
 *    signature="olstore.entity.Type 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_type"
 * 
 *--
 *  
 **/

public abstract class TypeBean implements EntityBean {
    
    /**
     * The  ejbCreate method.
     * 
     * @ejb.create-method 
     */
    public java.lang.String ejbCreate(java.lang.String name) throws javax.ejb.CreateException {
        setName (name);
        return null;
    }
    
    /**
     * The container invokes this method immediately after it calls ejbCreate.
     * 
     */
    public void ejbPostCreate(java.lang.String name) throws javax.ejb.CreateException {
    }
    
    /**
     * Returns the name
     * @return the name
     * 
     * @ejb.persistent-field 
     * @ejb.persistence
     *    column-name="name"
     *     sql-type="VARCHAR"
     * @ejb.pk-field 
     * @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 properties
     * @return the properties
     * 
     * @ejb.interface-method
     * 
     * @ejb.relation
     *  name="Type-Property"
     *  target-ejb="Property"
     *  role-name="Type-has-many-Properties"
     * 
     */
    public abstract java.util.Collection getProperties();
    
    /**
     * Sets the properties
     * 
     * @param java.util.Collection the new properties value
     * 
     * @ejb.interface-method
     */
    public abstract void setProperties(java.util.Collection properties);
    
}
