-
1. Re: Load relation failed 1-Many relationship
dsundstrom Jul 9, 2002 2:19 PM (in response to zommick)When did you purchase you documentation? If you purchased it before June of this year, you will need to buy the new updated documentation at flashline. If you purchased a subscription, then you can download the update from FlashLine.
-
2. Re: Load relation failed 1-Many relationship
zommick Jul 9, 2002 2:55 PM (in response to zommick)Other than obtaining the latest docs, do you know why its giving me that error?
-
3. Re: Load relation failed 1-Many relationship
dsundstrom Jul 9, 2002 4:40 PM (in response to zommick)The select clause is missing columns. This is usually caused by a misconfigured ejb-jar.xml file such as missing an prim-key-field element or a bad custom primary key. Another common cause trying to use unknown primary keys which are not currently supported.
-
4. Re: Load relation failed 1-Many relationship
zommick Jul 9, 2002 4:56 PM (in response to zommick)This is taken from my ejb-jar.xml . I have a prim-key-field defined for the unarchive request bean; however, the archive recording bean has a composite key so it just has primary class defined. What do you think?
<display-name>Unarchive Request Record</display-name>
<ejb-name>UnarchiveRequest</ejb-name>
com.radical.telephony.status.ejb.UnarchiveRequestHome
com.radical.telephony.status.ejb.UnarchiveRequest
<ejb-class>com.radical.telephony.status.ejb.UnarchiveRequestBean</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>java.lang.Integer</prim-key-class>
False
<cmp-version>2.x</cmp-version>
<abstract-schema-name>UnarchiveRequest</abstract-schema-name>
<cmp-field><field-name>requestId</field-name></cmp-field>
<cmp-field><field-name>requestTime</field-name></cmp-field>
<cmp-field><field-name>userName</field-name></cmp-field>
<cmp-field><field-name>status</field-name></cmp-field>
<primkey-field>requestId</primkey-field>
<resource-ref>
RCATSPool Data Source
<res-ref-name>java:/RCATSPool</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
<ejb-local-ref>
Archive Recording Record Home
<ejb-ref-name>ejb/rcats/ArchiveRecording</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
<ejb-link>ArchiveRecording</ejb-link>
<local-home>com.radical.telephony.status.ejb.ArchiveRecordingHomeLocal</local-home>
com.radical.telephony.status.ejb.ArchiveRecordingLocal
</ejb-local-ref>
<ejb-ref>
Archive Manager Bean Home
<ejb-ref-name>ejb/rcats/ArchiveManagerBean</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<ejb-link>ArchiveManagerBean</ejb-link>
com.radical.telephony.status.ejb.ArchiveManagerHome
com.radical.telephony.status.ejb.ArchiveManager
</ejb-ref>
EJBQL to find all UnarchiveRequests
<query-method>
<method-name>findAllRequests</method-name>
<method-params />
</query-method>
<ejb-ql>Select OBJECT(a) From UnarchiveRequest a</ejb-ql>
<display-name>Archive Recording Record</display-name>
<ejb-name>ArchiveRecording</ejb-name>
com.radical.telephony.status.ejb.ArchiveRecordingHome
com.radical.telephony.status.ejb.ArchiveRecording
<local-home>com.radical.telephony.status.ejb.ArchiveRecordingHomeLocal</local-home>
com.radical.telephony.status.ejb.ArchiveRecordingLocal
<ejb-class>com.radical.telephony.status.ejb.ArchiveRecordingBean</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>com.radical.telephony.status.ejb.ArchiveRecordingPK</prim-key-class>
False
<cmp-version>2.x</cmp-version>
<abstract-schema-name>ArchiveRecording</abstract-schema-name>
<cmp-field><field-name>systemId</field-name></cmp-field>
<cmp-field><field-name>stationId</field-name></cmp-field>
<cmp-field><field-name>timeStamp</field-name></cmp-field>
<cmp-field><field-name>mediaName</field-name></cmp-field>
<cmp-field><field-name>archiveNumber</field-name></cmp-field>
<cmp-field><field-name>status</field-name></cmp-field>
<resource-ref>
RCATSPool Data Source
<res-ref-name>java:/RCATSPool</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
<ejb-relation>
<ejb-relation-name>Request-Recording</ejb-relation-name>
<ejb-relationship-role>
<ejb-relationship-role-name>unarchiveRequest-has-many-recordings</ejb-relationship-role-name>
<relationship-role-source>
<ejb-name>UnarchiveRequest</ejb-name>
</relationship-role-source>
One
<cmr-field>
<cmr-field-name>recordingList</cmr-field-name>
<cmr-field-type>java.util.Collection</cmr-field-type>
</cmr-field>
</ejb-relationship-role>
<ejb-relationship-role>
<ejb-relationship-role-name>recording-belongsto-unarchiveRequest</ejb-relationship-role-name>
<relationship-role-source>
<ejb-name>ArchiveRecording</ejb-name>
</relationship-role-source>
Many
<cascade-delete/>
</ejb-relationship-role>
</ejb-relation> -
5. Re: Load relation failed 1-Many relationship
dsundstrom Jul 10, 2002 3:22 PM (in response to zommick)Then my guess is the custom primary key class is coded incorrectly (custom PKs are difficult to code correctly).
-
6. Re: Load relation failed 1-Many relationship
chadbo Mar 22, 2004 9:36 AM (in response to zommick)I often forget to make the fields public in my primary key class. That mistake also exhibits causes this problem. Gets, and setter, but the fields too must be public (though, I can't imaging why).
-
7. Re: Load relation failed 1-Many relationship
beal91 Mar 22, 2004 10:18 AM (in response to zommick)This is according to the specification:
Section 10.8.2:
The primary key class must be public, and must have a public constructor with no parameters.
All fields in the primary key class must be declared as public.
The names of the fields in the primary key class must be a subset of the names of the container-managed fields. (This allows the container to extract the primary key fields from an instance's container-managed fields, and vice versa.)
Jeff Beal