Hi,
the Orion distribution contains a small example application (news). A news
item is modeled by an CMP entity bean with remote interface NewsItem and EJB
class NewsItemEJB. News items can be ordered hierarchically, i.e. a news item
can have a parent. The code looks like this:
public class NewsItemEJB {
public NewsItem parent;
public String text;
public NewsItem getParent() {
return parent;
}
[...]
As you see, it has a CMP field 'parent' of type NewsItem (which is the remote
interface of the bean itself)...
How does this work?
Since there is a method 'getParent()', it seems like the container, after
retrieving a news item from the database, goes on and fetches also the parent
record, placing a reference to its remote interface in the sub-record... this
may even continue if the hierarchy is deeper
Any insights?
thx
Heiko