001: /*************************************************************************
002: * *
003: * EJBCA: The OpenSource Certificate Authority *
004: * *
005: * This software is free software; you can redistribute it and/or *
006: * modify it under the terms of the GNU Lesser General Public *
007: * License as published by the Free Software Foundation; either *
008: * version 2.1 of the License, or any later version. *
009: * *
010: * See terms of license at gnu.org. *
011: * *
012: *************************************************************************/package org.ejbca.core.ejb;
013:
014: import javax.ejb.CreateException;
015:
016: /**
017: * Base class for property entity beans implementing required methods and helpers.
018: * A property entity bean extends other entity beans with propertys.
019: *
020: * Primary Key is a combined id and property hash.
021: * id (String) primary key of entity bean using this property entity bean.
022: * property String should be one of the property constants.
023: * value (String) the value of the property.
024: *
025: * @version $Id: BasePropertyEntityBean.java,v 1.1 2006/01/17 20:30:04 anatom Exp $
026: *
027: * @ejb.bean
028: * generate="false"
029: * name="BaseProperty"
030: * display-name="BasePropertyEB"
031: * view-type="local"
032: * cmp-version="2.x"
033: *
034: * @ejb.pk
035: * class="org.ejbca.core.ejb.PropertyEntityPK"
036: * extends="java.lang.Object"
037: *
038: * @ejb.home
039: * generate="local"
040: * local-extends="javax.ejb.EJBLocalHome"
041: * local-class="org.ejbca.core.ejb.BasePropertyDataLocalHome"
042: *
043: * @ejb.interface
044: * generate="local"
045: * local-extends="javax.ejb.EJBLocalObject"
046: * local-class="org.ejbca.core.ejb.BasePropertyDataLocal"
047: */
048: public abstract class BasePropertyEntityBean extends BaseEntityBean {
049:
050: /**
051: * @ejb.persistence
052: * @ejb.pk-field
053: * @ejb.interface-method
054: */
055: public abstract String getId();
056:
057: /**
058: * @ejb.persistence
059: */
060: public abstract void setId(String id);
061:
062: /**
063: * @ejb.persistence
064: * @ejb.pk-field
065: * @ejb.interface-method
066: */
067: public abstract String getProperty();
068:
069: /**
070: * @ejb.persistence
071: */
072: public abstract void setProperty(String property);
073:
074: /**
075: * @ejb.persistence
076: * @ejb.interface-method
077: */
078: public abstract String getValue();
079:
080: /**
081: * @ejb.persistence
082: * @ejb.interface-method
083: */
084: public abstract void setValue(String value);
085:
086: /**
087: * Creates a new BasePropertyEntityBean object.
088: */
089: public BasePropertyEntityBean() {
090: super ();
091: }
092:
093: /**
094: * Entity Bean holding data of a raadmin profile.
095: * @return PropertyEntityPK beeing the PrimaryKey for the created entity
096: * @ejb.create-method
097: */
098: public PropertyEntityPK ejbCreate(String id, String property,
099: String value) throws CreateException {
100: PropertyEntityPK pk = new PropertyEntityPK(id, property);
101: setId(id);
102: setProperty(property);
103: setValue(value);
104: return pk;
105: }
106:
107: public void ejbPostCreate(String id, String property, String value) {
108: // Do nothing. Required.
109: }
110:
111: }
|