Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Should the cmr-field-type be only Collection or Set ?

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,
I am trying to implement a one to many relationship with entity beans, keeping
CMR fields at both the ends.
So my ejb-jar.xml looks something like:

<ejb-relation>
<ejb-relation-name>PlayerToPlayerTeam</ejb-relation-name>

<ejb-relationship-role>
...
<multiplicity>many</multiplicity>
...
<cmr-field>
<cmr-field-name>player</cmr-field-name>
<cmr-field-type>arun.roster.entity.IPlayer</cmr-field-type>
</cmr-field>
</ejb-relationship-role>

<ejb-relationship-role>
...
<multiplicity>one</multiplicity>
...
<cmr-field>
<cmr-field-name>teams</cmr-field-name>
<cmr-field-type>java.util.Collection</cmr-field-type>
</cmr-field>
</ejb-relationship-role>

</ejb-relation>


weblogic.ejbc is throwing following error:

ERROR: Error from ejbc: PAction[28824868](.ejb-jar.relationships.ejb-relation.ejb-relationship-role.cmr-field.cmr-field
-type.) must be one of the values: java.util.Set,java.util.Collection



My 'many' side of the realtionship is simple declaring a CMR field,
player of type arun.roster.entity.IPlayer. Can any one explain whats wrong with this.

Thanks in advance.
 
Ranch Hand
Posts: 284
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The cmr-field-type element should be used only when the cmr type is a collection. In this case, only java.util.Collection or java.util.Set may be used.

If your cmr field is a component interface, you must NOT use the cmr-field-type element.

Remember : if cmr-field-type element is used, it MUST be either Collection or Set collection types. If not, do NOT use the cmr-field-type element.
 
Arun Kandregula
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Frederic .
 
WHAT is your favorite color? Blue, no yellow, ahhhhhhh! Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic