001: package org.mockejb.test.entity;
002:
003: import javax.ejb.*;
004:
005: public abstract class AddressBean implements EntityBean {
006:
007: private EntityContext context = null;
008:
009: // getters and setters for CMP fields
010:
011: /**
012: * Returns the PK of this bean.
013: * @return the unique id of the Address bean
014: */
015: public abstract long getId();
016:
017: /**
018: * Sets the id of this bean. Container generates and sets it for us,
019: * so this method is not exposed on the business interface.
020: */
021: public abstract void setId(long id);
022:
023: public abstract String getStreet();
024:
025: public abstract void setStreet(String street);
026:
027: public abstract String getCity();
028:
029: public abstract void setCity(String city);
030:
031: public abstract String getState();
032:
033: public abstract void setState(String state);
034:
035: public abstract String getZipCode();
036:
037: public abstract void setZipCode(String zipCode);
038:
039: public abstract String getCountry();
040:
041: public abstract void setCountry(String country);
042:
043: // CMR
044: public abstract Person getPerson();
045:
046: public abstract void setPerson(Person person);
047:
048: // EJB create method
049: public Object ejbCreate(String street, String city, String state,
050: String zipCode, String country, Person person)
051: throws CreateException {
052:
053: setStreet(street);
054: setCity(city);
055: setState(state);
056: setZipCode(zipCode);
057: setCountry(country);
058:
059: return null;
060: }
061:
062: // Set CMR relationships here
063: public void ejbPostCreate(String street, String city, String state,
064: String zipCode, String country, Person person)
065: throws CreateException {
066:
067: setPerson(person);
068:
069: }
070:
071: public Object ejbCreate() throws CreateException {
072: return null;
073: }
074:
075: public void ejbPostCreate() throws CreateException {
076: }
077:
078: // Callback Methods
079:
080: public void setEntityContext(EntityContext c) {
081: context = c;
082: }
083:
084: public void unsetEntityContext() {
085: context = null;
086: }
087:
088: public void ejbRemove() throws RemoveException {
089: }
090:
091: public void ejbActivate() {
092: }
093:
094: public void ejbPassivate() {
095: }
096:
097: public void ejbStore() {
098: }
099:
100: public void ejbLoad() {
101: }
102: }
|