org.jboss.deployment.DeploymentException: Field id in prim-key-class must be the same type
Here's specifically what I have now:
------
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"
* pk-field="id"
* cmp-version="2.x"
*
* @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);
this.setMessageFile("filename");
return null;
}
/**
* The container invokes this method immediately after it calls ejbCreate.
*
*/
public void ejbPostCreate() throws javax.ejb.CreateException {
}
/** * 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 com.messagegate.foundation.id.UUID getId();
/**
* Sets the id
*
* @param java.lang.String the new id value
*
* @ejb.interface-method
*/
public abstract void setId(com.messagegate.foundation.id.UUID 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);
}
Harkness, David wrote:
bob combs wrote:
I'm having quite a time attempting to use a CMP bean with a custom PK^^
class w/ support in the value object. I'm sure I'm missing something
fairly simple.
[...]
In the Bean xdoclet
/**
* @ejb.bean name="Message"
* pk-field="id"
**/
[...]
public abstract com.messagegate.foundation.id.UUID getUUID();
I believe this is the problem, and it should cause problems with the CMP bean itself regardless of the VO. You either need to change the tag to
pk-field="UUID"
or change the accessor pair to
public abstract com...UUID getId();
Keep in mind that there are issues with CMP fields that begin with two or more capital letters. I would recommend going the latter route (name the field "id") to avoid further problems and to follow convention.
David Harkness Sr. Software Engineer Sony Pictures Digital Networks (310) 482-4756
------------------------------------------------------- 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_______________________________________________ xdoclet-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/xdoclet-user
------------------------------------------------------- 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