@ejb:aggregate and <<You asked the bean class for a NULL interface name>> error message
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Peter_Kolesnikov
Posted On:   Tuesday, April 9, 2002 07:50 AM

Sorry if it is more simplier than I think but I did not find much info about @ejb:aggregate tag in doc. As far as I understand I can get ref to another dataobject in dataobject if I mark ralational field of corresponding ejb as @aggregate. It allows then passing of a number of dataobjects to remote client. for example: if in samplessrcjava estejbcmrCountryBean.java I put for getCities: /** * @return all cities of this country * * @ejb:interface-method view-type="local" * @ejb:relation * name="country-city" * role-name="one-country-ha   More>>

Sorry if it is more simplier than I think but I did not
find much info about @ejb:aggregate tag in doc. As far
as I understand I can get ref to another dataobject in
dataobject if I mark ralational field of corresponding
ejb as @aggregate. It allows then passing of a number
of dataobjects to remote client.



for example:

if in

samplessrcjava estejbcmrCountryBean.java



I put for getCities:


/**

* @return all cities of this country

*

* @ejb:interface-method view-type="local"

* @ejb:relation

* name="country-city"

* role-name="one-country-has-many-cities"

* target-role-name="one-city-belongs-to-one-
country"

* target-ejb="City"

* target-multiple="no"

* @ejb:aggregate <----HERE IS MY NEW
AGGREGATE

* @weblogic:column-map

* foreign-key-column="country_id"

* key-column="id"

*

* @jboss:target-relation related-pk-field="id"

* fk-column="country_id"

*/

public abstract java.util.Collection getCities();





and as a result get following error: <
bean class for a NULL interface name>>



thnx in advance

Peter    <<Less

Re: @ejb:aggregate and &lt;&lt;You asked the bean class for a NULL interface name&gt;&gt; error message

Posted By:   Ara_Abrahamian  
Posted On:   Thursday, April 11, 2002 08:35 AM

Let's see what the docs have to say @about ejb:aggregate:


"Mark a persistent field containing a reference to another entity bean as
being aggregated in this bean. The data object will contain accessor methods for
the aggregated entity's data object instead of a reference to the entity itself.
The aggregated entity will also be removed when this entity is removed. For
example, aggregates are useful for sending graphs of data to the client. This is
only applicable to entity beans and has no parameters."


So you can't use it for getCities() because ejb:aggregate works only for a 1-1 relation to a single instance of another bean. What xdoclet does is it looks at the return type which should be the remote interface of a bean and find the actual ejb class and generate get/set for getting/setting the data object of that ejb.


Now what's the solution for your 1-n relationship case? Well, we're developing a new subtask called which will eventually phase out . It offers a lot more than what dataobject offers, including support for 1-n relations. It's available in v1.1.2 but is still considered under development but relativaly stable/useable. You should use this new subtask. Refer to docs and samples for more details.



Ara.

About | Sitemap | Contact