Hi,
the Entity-Bean "User" has got the stereotype "Identifier" and "Unique" for the
attribute "id". Before I didn't specify the attribute "id" because of AndroMDA
has built this automatically.
Here is the code of Entity-Bean "User":
// license-header java merge-point
/* Autogenerated by AndroMDA (EntityBean.vsl) - do not edit */
package fh.mdatutorial;
/**
* Autogenerated EJB implementation class for User
*
*
*
* @ejb.bean generate="true"
* name="User"
* type="CMP"
* cmp-version="2.x"
* view-type="local"
* local-jndi-name = "ejb/fh.mdatutorial.User/Local"
* reentrant="True"
* primkey-field = "id"
*
* @jboss.container-configuration name="Instance Per Transaction CMP 2.x
EntityBean"
* @jboss.tuned-updates
*
* @ejb.interface generate="false" local-class="fh.mdatutorial.User"
* @ejb.home generate="false" local-class="fh.mdatutorial.UserLocalHome"
* @ejb.pk generate="false" class="int"
*
* @ejb.transaction.type type="Required"
*
* @ejb.persistence table-name="USER"
*
* @ejb.finder signature="java.util.Collection findAll()"
* query="SELECT DISTINCT OBJECT(user) FROM User as user"
*
*/
public abstract class UserBean
implements javax.ejb.EntityBean {
// ----------- constant definitions -----------
// -- accessors for environment entries --
// -- accessors for constants --
// --------------- attributes ---------------------
/**
* Get the id property.
*
*
* @ejb.pk-field
* @ejb.persistence
* column-name="ID"
* jdbc-type="INTEGER"
* sql-type="INTEGER"
*
* @ejb.interface-method
*/
public abstract int getId();
/**
* Set the id property.
* @param value the new value
* @ejb.interface-method
*/
public abstract void setId(int value);
/**
* Get the name property.
*
*
* @ejb.persistence
* column-name="NAME"
* jdbc-type="VARCHAR"
* sql-type="VARCHAR(256)"
*
* @ejb.interface-method
*/
public abstract java.lang.String getName();
/**
* Set the name property.
* @param value the new value
* @ejb.interface-method
*/
public abstract void setName(java.lang.String value);
/**
* Get the password property.
*
*
* @ejb.persistence
* column-name="PASSWORD"
* jdbc-type="VARCHAR"
* sql-type="VARCHAR(256)"
*
* @ejb.interface-method
*/
public abstract java.lang.String getPassword();
/**
* Set the password property.
* @param value the new value
* @ejb.interface-method
*/
public abstract void setPassword(java.lang.String value);
// ------------- CMR relations ------------------
// ---------------- business and select methods ----------------------
/**
*
*
* @ejb.interface-method
*/
public abstract fh.mdatutorial.User create(int id, java.lang.String name,
java.lang.String password);
// ---------------- create methods --------------------
/**
* Implementation for the create method with all CMP attributes.
* This method calls the super class implementation for inherited
* CMP fields and sets all CMP fields defined in this class to the
* values provided by the parameters. Override this method in the
* implementation class if you need different behaviour.
*
* This extra implementation method is necessary to avoid
* problems with different primary key classes.
*
* @param id Value for the id property
* @param name Value for the name property
* @param password Value for the password property
*/
protected void createImpl(int id, java.lang.String name, java.lang.String
password)
throws javax.ejb.CreateException
{
setId(id);
setName(name);
setPassword(password);
}
/**
* Create method with all CMP attribute values.
* @param id Value for the id property
* @param name Value for the name property
* @param password Value for the password property
* @ejb.create-method
* @return <code>null</code> as required by the EJB specification for CMP
* (chapter 10.5.2, "Bean Provider's entity bean instance's view")
*/
public int ejbCreate(int id, java.lang.String name, java.lang.String
password)
throws javax.ejb.CreateException
{
createImpl(id, name, password);
return 0;
}
public void ejbPostCreate(int id, java.lang.String name, java.lang.String
password)
throws javax.ejb.CreateException
{
}
// ---------------- accessor methods for bean references ---------------
private javax.ejb.EntityContext ctx;
public void setEntityContext(javax.ejb.EntityContext ctx)
{
this.ctx = ctx;
}
public void unsetEntityContext()
{
ctx = null;
}
public void ejbRemove()
throws javax.ejb.RemoveException
{
}
public void ejbLoad()
{
}
public void ejbStore()
{
}
public void ejbPassivate()
{
}
public void ejbActivate()
{
}
}
_________________________________________________________
Reply to the post : http://galaxy.andromda.org/forum/viewtopic.php?p=2057#2057
Posting to http://forum.andromda.org/ is preferred over posting to the mailing
list!
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Andromda-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/andromda-user