ER-059 Implement matching 'ejbPostCreate ()' methods for every 'ejbCreate()' in EntityBean classes

Severity1
Enabledyes
Waivable
Violation
public class EnsureEjbPostCreateRuleViolationTestCase implements EntityBean {
	private static org.apache.log4j.Logger logger =	org.apache.log4j.Logger.getRootLogger();
	private transient EntityContext objcContext;
	private Integer mProdSubmissionID = null;
	public void setEntityContext(final EntityContext objaContext) {
		this.objcContext = objaContext;
	}
	public void unsetEntityContext() {
		objcContext = null;
	}
	public void ejbActivate() {
	}
	public void ejbPassivate() {
	}
	public void ejbLoad() {
	}
	public void ejbStore() {
	}
	public void ejbRemove() {
	}
	public Integer ejbCreate() throws CreateException, RemoteException {
		this.mProdSubmissionID = new Integer(0);
		return this.mProdSubmissionID;
	}
}
Fix
public class EnsureEjbPostCreateRuleFixTestCase implements EntityBean {
	private static org.apache.log4j.Logger logger =org.apache.log4j.Logger.getRootLogger();
	private transient EntityContext objcContext;
	private Integer mProdSubmissionID = null;
	public void setEntityContext(final EntityContext objaContext) {
		this.objcContext = objaContext;
	}
	public void unsetEntityContext() {
		objcContext = null;
	}
	public void ejbActivate() {
	}
	public void ejbPassivate() {
	}
	public void ejbLoad() {
	}
	public void ejbStore() {
	}
	public void ejbRemove() {
	}
	public Integer ejbCreate() throws CreateException, RemoteException {
		this.mProdSubmissionID = new Integer(0);
		return this.mProdSubmissionID;
	}
	public void ejbPostCreate() {
	}
}


Hammurapi 3 Copyright © 2004 Hammurapi Group. All Rights Reserved.