• Post Reply Bookmark Topic Watch Topic
  • New Topic

XDoclet and @ejb:relation  RSS feed

 
Maxim Suponya
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I'm haveing problems with setting relation between two ejbs using XDoclet tags. For example i've got CountryBean and CityBean, i need to get all cities of the country and country of the city. To do that in CountryBean i have this:
/**
* @ejb:interface-method view-type="local"
*/
public abstract void setCities(java.util.Collection cities);
/**
* @ejb:interface-method view-type="local"
* @ejb:relation
* name="country-cities"
* target-ejb="City"
* role-name="one-country-has-many-cities"
* target-role-name="one-city-belongs-to-one-country"
* target-multiple="no"
*/
public abstract java.util.Collection getCities();
and in CityBean i have this:
/**
* @ejb:interface-method view-type="local"
*/
public abstract void setCountry(CountryLocal country);
/**
* @ejb:interface-method view-type="local"
* @ejb:relation
* name="city-country"
* target-ejb="Country"
* role-name="one-city-belongs-to-one-country"
* target-role-name="one-country-has-many-cities"
*/
public abstract CountryLocal getCountry();
then, when i do city.getCountry() it works just fine, but when i do country.getCities() the Collection it returns is always empty
have i missed something?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!