Had to add a null constructor into UUID to get the create() to work due to CMP wanting to do a class.newInstance(), then populate data on the primary key. Now I just have to make the VO inherit from somewhere or merge methods in so I can get a get/set UUID. Some form of inheritance would be best, I suppose, then I could hide the get/set Id() methods.
Here's what eventually worked:
-------
package com.messagegate.mms.message.ejb;
import javax.ejb.EntityBean;
import com.messagegate.foundation.id.IdentifierFactory; import com.messagegate.foundation.id.UUID;
/**
* @ejb.bean name="Message"
* jndi-name="MessageBean"
* type="CMP"
* schema="mms"
* cmp-version="2.x"
* pk-field="id"
*
*
* @ejb.persistence
* table-name="MESSAGE"
*
* @ejb.pk class="com.messagegate.foundation.id.UUID" generate="false"
*
* @ejb.finder
* query="SELECT OBJECT(a) FROM mms as a" * signature="java.util.Collection findAll()" *
* **/
public abstract class MessageBean implements EntityBean {
/**
* The ejbCreate method.
*
* @ejb.create-method
*/
public com.messagegate.foundation.id.UUID ejbCreate() throws javax.ejb.CreateException {
UUID uuid = (UUID)IdentifierFactory.createUniqueIdentifier();
System.out.println("Creating Message: " + uuid.toString());
this.setId(uuid.getId());
this.setMessageFile("filename");
return null;
}
/**
* The container invokes this method immediately after it calls ejbCreate.
*
*/
public void ejbPostCreate() throws javax.ejb.CreateException {
}
public com.messagegate.foundation.id.UUID getPrimaryKey() {
com.messagegate.foundation.id.UUID pk = new com.messagegate.foundation.id.UUID(getId());
return pk;
}
/** * Returns the id * @return the id * * @ejb.persistent-field * @ejb.persistence * column-name="ID" * sql-type="CHAR(32)" * @ejb.pk-field * @ejb.interface-method * */ public abstract String getId();
/**
* Sets the id
*
* @param java.lang.String the new id value
*
* @ejb.interface-method
*/
public abstract void setId(String id);
/**
* Returns the messageFile
* @return the messageFile
*
* @ejb.persistent-field
* @ejb.persistence
* column-name="MESSAGE_FILE"
* sql-type="VARCHAR(256)"
* @ejb.interface-method
*
*/
public abstract java.lang.String getMessageFile();
/** * Sets the messageFile * * @param java.lang.String the new messageFile value * * @ejb.interface-method */ public abstract void setMessageFile(java.lang.String newMessageFile);
}
------------------------------------------------------- This SF.Net email is sponsored by Sleepycat Software Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to deliver higher performing products faster, at low TCO. http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3 _______________________________________________ xdoclet-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/xdoclet-user