On Mon, 28 Aug 2000, Simon Salykov wrote:

> Hi!
> 
> We are now deploying our applications using EJB 2.0 draft specification.
> We've discovered some bugs with dependents implementation (such as
> deployment fail on application with dependent containing cmp fields that
> must be serialized). Also all bugs discovered in EJB 1.1 implementation
> presents in EJB 2.0. But in general it works. What did you mean "Orion
> doesn't seem to handle correctly relationship between two CMP Entity, either
> with one to many or many to many relationship" ?

        Here is the description of my test. I want to create 2 entity
beans Campaign and MediaPlan. The relationship is one to many (a campaign
may contain several mediaplans but a mediaplan belongs to only one
campaign). Here is an extract from my ejb-jar:

        <relationships> 
                <ejb-relation> 
                 <ejb-relation-name>MediaPlan-Campaign</ejb-relation-name> 
                     <ejb-relationship-role> 
                                    <ejb-relationship-role-name> 
                                            campaign-has-mediaplan
                                    </ejb-relationship-role-name> 
                                    <multiplicity>many</multiplicity> 
                                    <role-source> 
                                            <ejb-name>Campaign</ejb-name> 
                                    </role-source> 
                                    <cmr-field> 
<cmr-field-name>mediaplans</cmr-field-name> 
<cmr-field-type>java.util.Collection</cmr-field-type> 
                                    </cmr-field> 
                        </ejb-relationship-role> 
                        <ejb-relationship-role> 
                                    <ejb-relationship-role-name> 
                                            mediaplan_belongsto_campaign
                                    </ejb-relationship-role-name> 
                                    <multiplicity>one</multiplicity>
                                    <cmr-field> 
<cmr-field-name>campaign</cmr-field-name> 
                                    </cmr-field> 
                                    <role-source> 
                                            <ejb-name>MediaPlan</ejb-name> 
                                    </role-source> 
                        </ejb-relationship-role> 
                </ejb-relation> 
        </relationships> 

Now when orion deploys it creates table that are IMHO uncessarly complex:

Auto-creating table: create table Campaign (id NUMBER not null primary
key, name VARCHAR2(255) null, creation_date DATE null, start_date DATE
null)

Auto-creating table: create table Campaign_mediaplans (id NUMBER not null,
value NUMBER null)

Auto-creating table: create table MediaPlan (mediaplanid NUMBER not null
primary key, name VARCHAR2(255) null, descr VARCHAR2(255) null, campaign
NUMBER null)

The join table Campaign_mediaplans is not necessary ...

then when I create a new mediaplan with campaign = 1 for example, it
works. But if I load the bean Campaign = 1 and I ask for the list of media
plans, the result is empty ... The table Campaign_mediaplans is empty
after the beans creation.

I'm not sure if I'm wrong or if it's an Orion problem, the EJB 2 draft is
not very clear to me.

Thanks.

-- 
Yann Doussot <[EMAIL PROTECTED]>
Grey Interactive - France - http://www.gifrance.com/



Reply via email to