Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Arun Kandregula
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • 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.
 
Frederic Esnault
Ranch Hand
Posts: 284
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Thanks Frederic .
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic