Discussion:
[Middlegen-user] generated code does not compile
H***@lsg.vanderlande.com
2004-02-27 09:27:03 UTC
Permalink
Hello,

the generated bean contains the following line:
public abstract class ContainerBean implements javax.ejb.EntityBean {

The javax.ejb.EntityBean interface requires the following methods and they
are not part of the generated code.
void ejbActivate()
void ejbLoad()
void ejbPassivate()
void ejbRemove()
void ejbStore()
void setEntityContext(EntityContext ctx)
void unsetEntityContext()

I don't want to modify the generated code by hand if possible.

How to include these methods?

Thanks
Haug



My ant task looks like:

<target name="generate_ejbs_from_db"
depends=""
description="Run Middlegen" >
<taskdef name="middlegen"
classname="middlegen.MiddlegenTask"
classpathref="middlegen.class.path" />
<middlegen appname="EntityBeanPerformance"
databaseurl="jdbc:oracle:thin:@gam-ora9-dev:1521:ORCL"
driver="oracle.jdbc.driver.OracleDriver"
username="J2EE"
password="xxxx"
datasourceJNDIName="java:/OracleDS"
providerURL="dummy"
initialContextFactory
="org.jnp.interfaces.NamingContextFactory"
gui="true" >
<cmp20 destination="src"
interfacepackage="com.vanderlande.lsg.wms.persistence"
fkcmp="true"
jndiprefix="wms/persistence"
package="com.vanderlande.lsg.wms.persistence"
viewtype="both">
</cmp20>
<table name="CONTAINER" />
<table name="CONTAINERTYPE" />
<table name="DELIVERY" />
<table name="DELIVERYLINE" />
<table name="ITEM" />
<table name="ITEMGROUP" />
<table name="ITEMGROUPATTRIBUTE" />
<table name="LOCATION" />
<table name="LOCATIONGROUP" />
<table name="LOCATIONGROUPMEMBER" />
<table name="LOCATIONTYPE" />
<table name="SKU" />
<table name="TRANSPORTTASK" />

</middlegen>
<mkdir dir="generated/src/middlegen"/>
</target>
Eivind Waaler
2004-02-27 10:03:03 UTC
Permalink
Hi, you don't need those methods when using CMP. That's why the bean class
is abstract i think..

Just try to deploy it. The server is supposed to create the implementation
itself. Some, like Weblogic, require special compilation (with ejbc tool)
others, as JBoss, do the implementation at deploy time i think.

Cheers
=2Eeivind
Post by H***@lsg.vanderlande.com
Hello,
public abstract class ContainerBean implements javax.ejb.EntityBean {
The javax.ejb.EntityBean interface requires the following methods and the=
y
Post by H***@lsg.vanderlande.com
are not part of the generated code.
void ejbActivate()
void ejbLoad()
void ejbPassivate()
void ejbRemove()
void ejbStore()
void setEntityContext(EntityContext=A0ctx)
void unsetEntityContext()
I don't want to modify the generated code by hand if possible.
How to include these methods?
Thanks
Haug
<target name=3D"generate_ejbs_from_db"
depends=3D""
description=3D"Run Middlegen" >
<taskdef name=3D"middlegen"
classname=3D"middlegen.MiddlegenTask"
classpathref=3D"middlegen.class.path" />
<middlegen appname=3D"EntityBeanPerformance"
driver=3D"oracle.jdbc.driver.OracleDriver"
username=3D"J2EE"
password=3D"xxxx"
datasourceJNDIName=3D"java:/OracleDS"
providerURL=3D"dummy"
initialContextFactory
=3D"org.jnp.interfaces.NamingContextFactory"
gui=3D"true" >
<cmp20 destination=3D"src"
interfacepackage=3D"com.vanderlande.lsg.wms.persistence"
fkcmp=3D"true"
jndiprefix=3D"wms/persistence"
package=3D"com.vanderlande.lsg.wms.persistence"
viewtype=3D"both">
</cmp20>
<table name=3D"CONTAINER" />
<table name=3D"CONTAINERTYPE" />
<table name=3D"DELIVERY" />
<table name=3D"DELIVERYLINE" />
<table name=3D"ITEM" />
<table name=3D"ITEMGROUP" />
<table name=3D"ITEMGROUPATTRIBUTE" />
<table name=3D"LOCATION" />
<table name=3D"LOCATIONGROUP" />
<table name=3D"LOCATIONGROUPMEMBER" />
<table name=3D"LOCATIONTYPE" />
<table name=3D"SKU" />
<table name=3D"TRANSPORTTASK" /
Loading...