001: /*
002: * JBoss, Home of Professional Open Source.
003: * Copyright 2006, Red Hat Middleware LLC, and individual contributors
004: * as indicated by the @author tags. See the copyright.txt file in the
005: * distribution for a full listing of individual contributors.
006: *
007: * This is free software; you can redistribute it and/or modify it
008: * under the terms of the GNU Lesser General Public License as
009: * published by the Free Software Foundation; either version 2.1 of
010: * the License, or (at your option) any later version.
011: *
012: * This software is distributed in the hope that it will be useful,
013: * but WITHOUT ANY WARRANTY; without even the implied warranty of
014: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015: * Lesser General Public License for more details.
016: *
017: * You should have received a copy of the GNU Lesser General Public
018: * License along with this software; if not, write to the Free
019: * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
020: * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
021: */
022: package org.jboss.test.cmp2.commerce;
023:
024: import java.util.Collection;
025: import javax.ejb.CreateException;
026: import javax.ejb.EntityBean;
027: import javax.ejb.EntityContext;
028:
029: import org.jboss.varia.autonumber.AutoNumberFactory;
030:
031: public abstract class ProductBean implements EntityBean {
032: transient private EntityContext ctx;
033:
034: public Long ejbCreate() throws CreateException {
035: setId(new Long(AutoNumberFactory.getNextInteger("Product")
036: .longValue()));
037: return null;
038: }
039:
040: public void ejbPostCreate() {
041: }
042:
043: public abstract Long getId();
044:
045: public abstract void setId(Long id);
046:
047: public abstract String getName();
048:
049: public abstract void setName(String name);
050:
051: public abstract String getType();
052:
053: public abstract void setType(String type);
054:
055: public abstract String getUnit();
056:
057: public abstract void setUnit(String unit);
058:
059: public abstract double getCostPerUnit();
060:
061: public abstract void setCostPerUnit(double cost);
062:
063: public abstract double getWeight();
064:
065: public abstract void setWeight(double weight);
066:
067: public abstract double getLength();
068:
069: public abstract void setLength(double length);
070:
071: public abstract double getGirth();
072:
073: public abstract void setGirth(double girth);
074:
075: public abstract Collection getProductCategories();
076:
077: public abstract void setProductCategories(
078: Collection productCategories);
079:
080: public void setEntityContext(EntityContext ctx) {
081: this .ctx = ctx;
082: }
083:
084: public void unsetEntityContext() {
085: this .ctx = null;
086: }
087:
088: public void ejbActivate() {
089: }
090:
091: public void ejbPassivate() {
092: }
093:
094: public void ejbLoad() {
095: }
096:
097: public void ejbStore() {
098: }
099:
100: public void ejbRemove() {
101: }
102: }
|