I did put that in. In fact, it was your examples
that I based all my development on :)
I just don't see any differences between your
descriptor file and mine.
-tim
> -----Original Message-----
> From: Jim Archer [mailto:[EMAIL PROTECTED]]
> Sent: Friday, November 10, 2000 2:31 PM
> To: Tim Drury; Orion-Interest
> Subject: RE: ejb2: EJB->DO, 1 to many problem
>
>
> Hi Tim...
>
> No, I didn't mean in the relationship tag. Sorry for the
> confusion. My
> fault entirely. I meant in the <entity> tag.
>
> The descriptor I pasted below is an example of one which
> fails to deploy on
> Orion 1.4.0 because of a now fixed Orion bug (I have not yet
> retested but
> Bugzilla says its fixed in 1.4.4). However, if you exampne
> the part that
> defines the entity beans you'll see what I mean. There is a
> comment you
> can't miss.
>
> Let us know if it works and if not we'll look at other things.
>
> Jim
>
>
> <?xml version="1.0"?>
> <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise
> JavaBeans 2.0//EN" "http://java.sun.com/j2ee/dtds/ejb-jar_2_0.dtd">
> <ejb-jar>
> <description>Test Sample EJB 2.0 EB</description>
> <display-name>Person</display-name>
> <enterprise-beans>
> <entity>
> <cmp-version>2.0</cmp-version>
> <description>Person</description>
>
> <display-name>Test20CmpDoOM.eb.Person</display-name>
> <ejb-name>Test20CmpDoOM.eb.PersonEJB</ejb-name>
> <home>Test20CmpDoOM.eb.PersonHome</home>
> <remote>Test20CmpDoOM.eb.Person</remote>
>
> <ejb-class>Test20CmpDoOM.eb.PersonEJB</ejb-class>
> <persistence-type>Container</persistence-type>
>
> <prim-key-class>java.lang.String</prim-key-class>
> <reentrant>True</reentrant>
>
> <!-- These lines should not be required
> (according to the spec) -->
> <!-- but without them deployment fails -->
>
> <cmp-field><field-name>addrDo</field-name></cmp-field>
>
> <cmp-field><field-name>emailDos</field-name></cmp-field>
>
>
> <cmp-field><field-name>userId</field-name></cmp-field>
>
> <cmp-field><field-name>firstName</field-name></cmp-field>
>
> <cmp-field><field-name>lastName</field-name></cmp-field>
>
> <primkey-field>userId</primkey-field>
> </entity>
> </enterprise-beans>
>
> <dependents>
> <dependent>
> <dependent-name>addrDo</dependent-name>
>
> <dependent-class>Test20CmpDoOM.eb.AddrDo</dependent-class>
>
> <cmp-field><field-name>street</field-name></cmp-field>
>
> <cmp-field><field-name>city</field-name></cmp-field>
>
> <cmp-field><field-name>state</field-name></cmp-field>
>
> <cmp-field><field-name>zip</field-name></cmp-field>
> </dependent>
> <dependent>
> <dependent-name>emailDo</dependent-name>
>
> <dependent-class>Test20CmpDoOM.eb.EmailDo</dependent-class>
>
> <cmp-field><field-name>email</field-name></cmp-field>
>
> <cmp-field><field-name>person</field-name></cmp-field>
> </dependent>
> </dependents>
>
> <relationships>
> <ejb-relation>
>
> <ejb-relation-name>Person-Address</ejb-relation-name>
> <ejb-relationship-role>
>
>
> <ejb-relationship-role-name>Person-has-Address</ejb-relationsh
> ip-role-name>
> <multiplicity>one</multiplicity>
>
> <role-source><ejb-name>Test20CmpDoOM.eb.Person</ejb-name></rol
> e-source>
> <cmr-field>
>
> <cmr-field-name>addrDo</cmr-field-name>
>
> <cmr-field-type>Test20CmpDoOM.eb.AddrDo</cmr-field-type>
> </cmr-field>
> </ejb-relationship-role>
> <ejb-relationship-role>
>
>
> <ejb-relationship-role-name>Address-belongsto-User</ejb-relati
> onship-role-
> name>
> <multiplicity>one</multiplicity>
>
> <role-source><dependent-name>addrDo</dependent-name></role-source>
> </ejb-relationship-role>
> </ejb-relation>
>
> <ejb-relation>
>
> <ejb-relation-name>Person-Email</ejb-relation-name>
> <ejb-relationship-role>
>
>
> <ejb-relationship-role-name>Person-has-Email</ejb-relationship
> -role-name>
> <multiplicity>one</multiplicity>
>
>
> <role-source><ejb-name>Test20CmpDoOM.eb.PersonEJB</ejb-name></
> role-source>
> <cmr-field>
>
> <cmr-field-name>emailDos</cmr-field-name>
>
> <cmr-field-type>java.util.Collection</cmr-field-type>
> </cmr-field>
> </ejb-relationship-role>
> <ejb-relationship-role>
>
>
> <ejb-relationship-role-name>Email-belongsto-User</ejb-relation
> ship-role-na
> me>
> <multiplicity>many</multiplicity>
>
> <role-source><dependent-name>emailDo</dependent-name></role-source>
> <!-- -->
> <cmr-field>
>
> <cmr-field-name>person</cmr-field-name>
>
> <cmr-field-type>Test20CmpDoOM.eb.Person</cmr-field-type>
> </cmr-field>
> <!-- -->
> </ejb-relationship-role>
> </ejb-relation>
> </relationships>
>
> <assembly-descriptor>
> <security-role>
> <description>Users</description>
> <role-name>users</role-name>
> </security-role>
> </assembly-descriptor>
> </ejb-jar>
>
>
> --On Friday, November 10, 2000 2:19 PM -0500 Tim Drury
> <[EMAIL PROTECTED]> wrote:
>
> >
> > Jim,
> >
> > Thanks for the quick response. I'm using 1.4 and I've
> > gotten 1:1 to work. I think my problem may be what
> > you mentioned about a non-standard CMR field in
> > ejb-jar.xml. What are you talking about exactly?
> > In the <relationship> tag? Here is my relationship
> > area again:
> >
> > <ejb-relation>
> > <ejb-relation-name>EdiFile-EdiEnvelopes</ejb-relation-name>
> > <ejb-relationship-role>
> >
> >
> <ejb-relationship-role-name>EdiFile-has-EdiEnvelopes</ejb-rela
> tionship-ro
> > le- name>
> > <multiplicity>one</multiplicity>
> > <role-source>
> > <ejb-name>EdiFileEJB</ejb-name>
> > </role-source>
> > <cmr-field>
> > <cmr-field-name>envelopes</cmr-field-name>
> > <cmr-field-type>java.util.Collection</cmr-field-type>
> > </cmr-field>
> > </ejb-relationship-role>
> >
> > <ejb-relationship-role>
> >
> >
> <ejb-relationship-role-name>EdiEnvelopes-belongsto-EdiFile</ej
> b-relations
> > hip -role-name>
> > <multiplicity>many</multiplicity>
> > <role-source>
> > <dependent-name>EdiEnvelope</dependent-name>
> > </role-source>
> > <cmr-field>
> > <cmr-field-name>ediFile</cmr-field-name>
> > </cmr-field>
> > </ejb-relationship-role>
> > </ejb-relation>
> >
> >
> >> -----Original Message-----
> >> From: Jim Archer [mailto:[EMAIL PROTECTED]]
> >> Sent: Friday, November 10, 2000 1:14 PM
> >> To: Orion-Interest
> >> Cc: Tim Drury
> >> Subject: Re: ejb2: EJB->DO, 1 to many problem
> >>
> >>
> >> Hi Tim...
> >>
> >> I'll take a stab at trying to help with this. I have done a
> >> lot of work
> >> with dependent objects.
> >>
> >> First, using Orion 1.4.0 I found that unidirectional
> >> dependents work as
> >> they should (when an EB has dependents). If you have an EB
> >> with dependents
> >> in a 1-to-1 relationship, Orion will create one table and map
> >> the fields of
> >> the dependent into the table for the EB. If you have a 1-ri-n
> >> relationship,
> >> Orion will create two tables.
> >>
> >> I have found that Orion 1.4.0 does work with dependents in a
> >> unidirectional
> >> relationship properly. The error your reporting seems to indicate a
> >> descriptor error. Remember that Orion 1.4.0 has a bug in
> >> which you must
> >> define the CMR field also as a CMP field (in violation of all
> >> EJB 2.0 spec
> >> revisions).
> >>
> >> I have also found that Orion 1.4.0 fasils to work properly with
> >> bidirectional dependent relationships. According to Bugzilla,
> >> this has been
> >> fixed in Orion 1.4.4 but I have not attempted to test this yet.
> >>
> >> If you can tell us what version of Orion your using and post
> >> the relevant
> >> portion of your descriptor we can probably offer better assistence.
> >>
> >> Jim
> >>
> >>
> >> --On Friday, November 10, 2000 10:42 AM -0500 Tim Drury
> >> <[EMAIL PROTECTED]> wrote:
> >>
> >> >
> >> > I've gotten EJB->dep obj working for 1-to-1 and
> >> > I've gotten EJB->EJB 1-to-1 and 1-to-many working.
> >> > But for the life of me, I cannot get EJB->dep obj
> >> > working for 1-to-many.
> >> >
> >> > The object model is:
> >> >
> >> > EdiFile(EJB) ---- 1 to N ----- EdiEnvelope (DO)
> >> >
> >> > This is a unidirectional relationship. I think
> >> > someone has been trying bi-directional with no
> >> > luck.
> >> >
> >> > The problem manifests itself in two ways. First,
> >> > Orion throws an error when it tries to compiles
> >> > the stubs/skeletons:
> >> >
> >> > class EdiEnvelope_Dependent0 is an abstract class.
> >> > It can't be instantiated.
> >> >
> >> > (well this is obvious; dependent objects are supposed
> >> > to be abstract).
> >> >
> >> > Second, the database table for my EJB doesn't contain
> >> > _any_ reference to the dependent object. BTW, the
> >> > table for the dependent object looks fine.
> >> >
> >> > Thanks for any help,
> >> > -tim
> >> >
> >> >
> >> >
> >> > Here is my dependent object:
> >> >
> >> > ------------------------------------------------------
> >> > package com.tfc.ejb;
> >> >
> >> > import java.rmi.RemoteException;
> >> > import javax.ejb.RemoveException;
> >> >
> >> > import java.util.Date;
> >> > import java.util.Collection;
> >> > import java.util.Iterator;
> >> >
> >> > public abstract class EdiEnvelope implements java.io.Serializable
> >> > {
> >> > public abstract void setSenderIdQualifier(String s) throws
> >> > RemoteException;
> >> > public abstract void setSenderId(String s) throws
> >> RemoteException;
> >> > public abstract void setReceiverIdQualifier(String s) throws
> >> > RemoteException;
> >> > public abstract void setReceiverId(String s) throws
> >> RemoteException;
> >> > public abstract void setDate(Date d) throws RemoteException;
> >> > public abstract void setVersion(String s) throws
> RemoteException;
> >> > public abstract void setControlNumber(long l) throws
> >> RemoteException;
> >> > public abstract void setAck(boolean b) throws RemoteException;
> >> > public abstract void setNumberOfGroups(int i) throws
> >> RemoteException;
> >> > public abstract void setTransactionSets(Collection c) throws
> >> > RemoteException;
> >> > public abstract void setId(String s) throws RemoteException;
> >> >
> >> > public abstract String getSenderIdQualifier() throws
> >> RemoteException;
> >> > public abstract String getSenderId() throws RemoteException;
> >> > public abstract String getReceiverIdQualifier() throws
> >> RemoteException;
> >> > public abstract String getReceiverId() throws RemoteException;
> >> > public abstract Date getDate() throws RemoteException;
> >> > public abstract String getVersion() throws RemoteException;
> >> > public abstract long getControlNumber() throws
> RemoteException;
> >> > public abstract boolean getAck() throws RemoteException;
> >> > public abstract int getNumberOfGroups() throws
> RemoteException;
> >> > public abstract Collection getTransactionSets() throws
> >> RemoteException;
> >> > public abstract String getId() throws RemoteException;
> >> >
> >> > public String ejbCreateEdiEnvelope() throws RemoteException
> >> > {
> >> > this.setId( (new java.rmi.server.UID()).toString() );
> >> > return null;
> >> > }
> >> > public void ejbPostCreateEdiEnvelope() { }
> >> > public abstract EdiEnvelope deepCopy();
> >> >
> >> > } // end EdiEnvelope
> >> > ----------------------------------------------------------
> >> >
> >> > Here is my EJB:
> >> >
> >> > ----------------------------------------------------------
> >> > package com.tfc.ejb;
> >> >
> >> > import javax.ejb.EntityBean;
> >> > import javax.ejb.CreateException;
> >> > import javax.ejb.RemoveException;
> >> > import java.rmi.RemoteException;
> >> > import javax.ejb.EntityContext;
> >> >
> >> > import java.util.Date;
> >> > import java.util.Iterator;
> >> > import java.util.Collection;
> >> >
> >> > public abstract class EdiFileEJB implements EntityBean
> >> > {
> >> > private EntityContext ec;
> >> >
> >> > // accessors
> >> >
> >> > public void setEntityContext(EntityContext ec) {
> this.ec = ec; }
> >> > public void unsetEntityContext() { ec = null; }
> >> >
> >> > public abstract void setFilename(String s);
> >> > public abstract void setDateDownloaded(Date d);
> >> > public abstract void setEnvelopes(Collection c);
> >> > public abstract void setId(String s);
> >> >
> >> > public abstract String getFilename();
> >> > public abstract Date getDateDownloaded();
> >> > public abstract Collection getEnvelopes();
> >> > public abstract String getId();
> >> >
> >> > public long getNumberOfEnvelopes()
> >> > {
> >> > Collection c = this.getEnvelopes();
> >> > return c.size();
> >> > }
> >> > public long getEnvelopeControlNumber(int index) throws
> >> RemoteException
> >> > {
> >> > long controlNumber = 0;
> >> > Collection c = this.getEnvelopes();
> >> > try {
> >> > EdiEnvelope[] ea = (EdiEnvelope[])c.toArray();
> >> > EdiEnvelope e = ea[index];
> >> > controlNumber = e.getControlNumber();
> >> > } catch (Exception ex) {
> >> > throw new RemoteException("index out of bounds");
> >> > }
> >> > return controlNumber;
> >> > }
> >> >
> >> > public void addEnvelope(String senderIdQualifier,
> >> > String senderId,
> >> > String receiverIdQualifier,
> >> > String receiverId,
> >> > Date date,
> >> > String version,
> >> > long controlNumber,
> >> > boolean ack) throws RemoteException,
> >> > CreateException
> >> > {
> >> > EdiEnvelope e = this.createEdiEnvelope();
> >> > e.setSenderIdQualifier(senderIdQualifier);
> >> > e.setSenderId(senderId);
> >> > e.setReceiverIdQualifier(receiverIdQualifier);
> >> > e.setReceiverId(receiverId);
> >> > e.setDate(date);
> >> > e.setVersion(version);
> >> > e.setControlNumber(controlNumber);
> >> > e.setAck(ack);
> >> > this.getEnvelopes().add(e);
> >> > }
> >> >
> >> > public abstract EdiEnvelope createEdiEnvelope() throws
> >> CreateException;
> >> >
> >> > public String ejbCreate()
> >> > {
> >> > this.setId( (new java.rmi.server.UID()).toString() );
> >> > return null;
> >> > }
> >> >
> >> > public void ejbPostCreate() { }
> >> > public void ejbActivate() { }
> >> > public void ejbPassivate() { }
> >> > public void ejbLoad() { }
> >> > public void ejbStore() { }
> >> > public void ejbRemove() { }
> >> > } // end EdiFileEJB
> >> >
> >> > ---------------------------------------------------
> >> >
> >> > and here are the relevent parts of ejb-jar.xml:
> >> >
> >> > ----------------------------------------------------
> >> >
> >> > ...
> >> > <entity>
> >> > <cmp-version>2.x</cmp-version>
> >> > <description>EDI file</description>
> >> > <ejb-name>EdiFileEJB</ejb-name>
> >> > <home>com.tfc.ejb.EdiFileHome</home>
> >> > <remote>com.tfc.ejb.EdiFile</remote>
> >> > <ejb-class>com.tfc.ejb.EdiFileEJB</ejb-class>
> >> > <persistence-type>Container</persistence-type>
> >> > <reentrant>False</reentrant>
> >> > <cmp-field>
> >> > <field-name>filename</field-name>
> >> > </cmp-field>
> >> > <cmp-field>
> >> > <field-name>dateDownloaded</field-name>
> >> > </cmp-field>
> >> > <cmp-field>
> >> > <field-name>envelopes</field-name>
> >> > </cmp-field>
> >> > <cmp-field>
> >> > <field-name>id</field-name>
> >> > </cmp-field>
> >> > <primkey-field>id</primkey-field>
> >> > <prim-key-class>java.lang.String</prim-key-class>
> >> > </entity>
> >> > ...
> >> >
> >> > <dependent>
> >> > <dependent-name>EdiEnvelope</dependent-name>
> >> >
> <dependent-class>com.tfc.ejb.EdiEnvelope</dependent-class>
> >> > <cmp-field>
> >> > <field-name>senderIdQualifier</field-name>
> >> > </cmp-field>
> >> > <cmp-field>
> >> > <field-name>senderId</field-name>
> >> > </cmp-field>
> >> > <cmp-field>
> >> > <field-name>receiverIdQualifier</field-name>
> >> > </cmp-field>
> >> > <cmp-field>
> >> > <field-name>receiverId</field-name>
> >> > </cmp-field>
> >> > <cmp-field>
> >> > <field-name>date</field-name>
> >> > </cmp-field>
> >> > <cmp-field>
> >> > <field-name>version</field-name>
> >> > </cmp-field>
> >> > <cmp-field>
> >> > <field-name>controlNumber</field-name>
> >> > </cmp-field>
> >> > <cmp-field>
> >> > <field-name>ack</field-name>
> >> > </cmp-field>
> >> > <cmp-field>
> >> > <field-name>transactionSets</field-name>
> >> > </cmp-field>
> >> > <cmp-field>
> >> > <field-name>id</field-name>
> >> > </cmp-field>
> >> > <prim-key-class>java.lang.String</prim-key-class>
> >> > <primkey-field>id</primkey-field>
> >> > </dependent>
> >> >
> >> > ...
> >> >
> >> > <ejb-relation>
> >> >
> <ejb-relation-name>EdiFile-EdiEnvelopes</ejb-relation-name>
> >> > <ejb-relationship-role>
> >> >
> >> >
> >> <ejb-relationship-role-name>EdiFile-has-EdiEnvelopes</ejb-rela
> >> tionship-ro
> >> > le- name>
> >> > <multiplicity>one</multiplicity>
> >> > <role-source>
> >> > <ejb-name>EdiFileEJB</ejb-name>
> >> > </role-source>
> >> > <cmr-field>
> >> > <cmr-field-name>envelopes</cmr-field-name>
> >> >
> <cmr-field-type>java.util.Collection</cmr-field-type>
> >> > </cmr-field>
> >> > </ejb-relationship-role>
> >> > <ejb-relationship-role>
> >> >
> >> >
> >> <ejb-relationship-role-name>EdiEnvelopes-belongsto-EdiFile</ej
> >> b-relations
> >> > hip -role-name>
> >> > <multiplicity>many</multiplicity>
> >> > <role-source>
> >> > <dependent-name>EdiEnvelope</dependent-name>
> >> > </role-source>
> >> > <cmr-field>
> >> > <cmr-field-name>ediFile</cmr-field-name>
> >> > </cmr-field>
> >> > </ejb-relationship-role>
> >> > </ejb-relation>
> >> >
> >>
> >>
> >>
> >>
>
>
>
>