Hi,
I have two entity beans, Author and Contact. There is an 1-1
unidirectional relationshop from Author to Contact. My value objects
are generated as <bean-name>Dto (ie. AuthorDto/ContactDto).
When the generated AuthorCMP.java file is compiled it get the following
error:
AuthorCMP.java:343: cannot resolve symbol
symbol : method setContact(ContactDto)
location: interface ContactLocal
relation.setContact(valueHolder.getContact());
^
The problem seems to be that xdoclet is not generating the correct
method name when it does
"relation.setContact(valueHolder.getContact());" in AuthorCMP.java. It
should be calling the value object set method defined in the
ContactBean, correct? The set method in ContactBean is called
setContactDto, not setContact.
I have another compose relationship between Author and PrivilegeLevels.
It is 1-N unidirectional. It is also declared as a compose value object
property. The code for that is fine in AuthorCMP.
Is this just a problem when the relation is 1-1?
Am I just doing something stupid, or is this a bug?
Thanks a lot!
Nate
Here is the relevant xdoclet stuff from the Author bean:
/**
* Get the contact info associated with this author.
*
* @return the Contact information
*
* @ejb.value-object
* compose="ContactDto"
* compose-name="Contact"
* members="ContactLocal"
* members-name="Contact"
* relation="external"
*
* @ejb.relation
* name="Author-Contact"
* role-name="author-has-contact"
* target-ejb="Contact"
* target-role-name="contact-belongs-to-author"
*
* @jboss.relation
* fk-column="contact_id"
* related-pk-field="contactId"
*/
public abstract ContactLocal getContact();
/**
* Set the contact information for an author.
*
* @param contactInfo The contact information to use.
*
* @ejb.interface-method
*/
public abstract void setContact(ContactLocal contact);
The relevant section of AuthorCMP is here:
// Checks for null composition
if (valueHolder.getContact() != null)
{
java.lang.Long pk = valueHolder.getContact().getContactId();
ContactLocalHome home = ContactUtil.getLocalHome();
ContactLocal relation = home.findByPrimaryKey(pk);
relation.setContact(valueHolder.getContact());
}
The get/set value object methods from Contact are like this:
/**
* Get the ContactDto
*
* @return A ContactDto
*
* @ejb.interface-method
*
*/
public abstract ContactDto getContactDto();
/**
* Set the ContactDto
*
* @param contactDto The ContactDto
*
* @ejb.interface-method
*/
public abstract void setContactDto( ContactDto contactDto );
-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine.
WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines
at the same time. Free trial click here:http://www.vmware.com/wl/offer/358/0
_______________________________________________
xdoclet-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-user