You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by Aaron Mulder <am...@alumni.princeton.edu> on 2005/07/28 04:43:42 UTC

EJB Relationship Mapping Names

	What's the purpose of the ejb-relation-name and
ejb-relationship-role-name elements at:

openejb-jar/relationships/ejb-relation/ejb-relation-name

openejb-jar/relationships/ejb-relation/ejb-relationship-role/
                                       ejb-relationship-role-name

	It seems that we ignore those, and don't validate them against
each other even if they're present in both ejb-jar.xml and openejb-jar.xml
(they're optional in both files).  I guess it could be used for
"documentation", but then I'd prefer to make it a description element
instead of something that looks like it ought to be present.

Thanks,
	Aaron

Re: EJB Relationship Mapping Names

Posted by Gianny Damour <gi...@optusnet.com.au>.
You convinced me. Let's rename these elements description.

Thanks,
Gianny

On 28/07/2005 1:07 PM, Aaron Mulder wrote:

>	I don't like including fields for documentation purposes that have 
>a name that doesn't make it clear that they're only for documentation.  
>As Jeremy just demonstrated, it's easy to convince yourself that those 
>fields should be used in some cases (and I was moderately convinced of 
>that myself earlier this evening).  But in fact, they're totally 
>unnecessary, and if you set them to contradict the same fields in 
>ejb-jar.xml for the same relation (or relationship role) then there's no 
>ill effect whatsoever.
>
>	If we were going to try to match the ejb-jar.xml schema, then we
>should validate that values are the same across the ejb-jar block and
>openejb-jar block (assuming they're both present).  But really, what's the
>benefit of not just including a "description" element instead?  That way 
>someone can put in "matches relation 'foo' in ejb-jar.xml" or they can put 
>some other meaningful description or leave it out entirely, and it's 
>obvious that it's not an important field as far as the server is 
>concerned.
>
>Thanks,
>	Aaron
>
>On Thu, 28 Jul 2005, Gianny Damour wrote:
>
>  
>
>>Hi,
>>
>>They are indeed not used except for documentation purposes. I am not 
>>sure that we should rename them documentation as this will not mirror 
>>the standard DD.
>>
>>Thanks,
>>Gianny
>>
>>On 28/07/2005 12:43 PM, Aaron Mulder wrote:
>>
>>    
>>
>>>	What's the purpose of the ejb-relation-name and
>>>ejb-relationship-role-name elements at:
>>>
>>>openejb-jar/relationships/ejb-relation/ejb-relation-name
>>>
>>>openejb-jar/relationships/ejb-relation/ejb-relationship-role/
>>>                                      ejb-relationship-role-name
>>>
>>>	It seems that we ignore those, and don't validate them against
>>>each other even if they're present in both ejb-jar.xml and openejb-jar.xml
>>>(they're optional in both files).  I guess it could be used for
>>>"documentation", but then I'd prefer to make it a description element
>>>instead of something that looks like it ought to be present.
>>>
>>>Thanks,
>>>	Aaron
>>>
>>>
>>> 
>>>
>>>      
>>>
>>
>>    
>>
>
>
>  
>



Re: EJB Relationship Mapping Names

Posted by Aaron Mulder <am...@alumni.princeton.edu>.
	I don't like including fields for documentation purposes that have 
a name that doesn't make it clear that they're only for documentation.  
As Jeremy just demonstrated, it's easy to convince yourself that those 
fields should be used in some cases (and I was moderately convinced of 
that myself earlier this evening).  But in fact, they're totally 
unnecessary, and if you set them to contradict the same fields in 
ejb-jar.xml for the same relation (or relationship role) then there's no 
ill effect whatsoever.

	If we were going to try to match the ejb-jar.xml schema, then we
should validate that values are the same across the ejb-jar block and
openejb-jar block (assuming they're both present).  But really, what's the
benefit of not just including a "description" element instead?  That way 
someone can put in "matches relation 'foo' in ejb-jar.xml" or they can put 
some other meaningful description or leave it out entirely, and it's 
obvious that it's not an important field as far as the server is 
concerned.

Thanks,
	Aaron

On Thu, 28 Jul 2005, Gianny Damour wrote:

> Hi,
> 
> They are indeed not used except for documentation purposes. I am not 
> sure that we should rename them documentation as this will not mirror 
> the standard DD.
> 
> Thanks,
> Gianny
> 
> On 28/07/2005 12:43 PM, Aaron Mulder wrote:
> 
> >	What's the purpose of the ejb-relation-name and
> >ejb-relationship-role-name elements at:
> >
> >openejb-jar/relationships/ejb-relation/ejb-relation-name
> >
> >openejb-jar/relationships/ejb-relation/ejb-relationship-role/
> >                                       ejb-relationship-role-name
> >
> >	It seems that we ignore those, and don't validate them against
> >each other even if they're present in both ejb-jar.xml and openejb-jar.xml
> >(they're optional in both files).  I guess it could be used for
> >"documentation", but then I'd prefer to make it a description element
> >instead of something that looks like it ought to be present.
> >
> >Thanks,
> >	Aaron
> >
> >
> >  
> >
> 
> 
> 

Re: EJB Relationship Mapping Names

Posted by Gianny Damour <gi...@optusnet.com.au>.
Hi,

They are indeed not used except for documentation purposes. I am not 
sure that we should rename them documentation as this will not mirror 
the standard DD.

Thanks,
Gianny

On 28/07/2005 12:43 PM, Aaron Mulder wrote:

>	What's the purpose of the ejb-relation-name and
>ejb-relationship-role-name elements at:
>
>openejb-jar/relationships/ejb-relation/ejb-relation-name
>
>openejb-jar/relationships/ejb-relation/ejb-relationship-role/
>                                       ejb-relationship-role-name
>
>	It seems that we ignore those, and don't validate them against
>each other even if they're present in both ejb-jar.xml and openejb-jar.xml
>(they're optional in both files).  I guess it could be used for
>"documentation", but then I'd prefer to make it a description element
>instead of something that looks like it ought to be present.
>
>Thanks,
>	Aaron
>
>
>  
>



Re: EJB Relationship Mapping Names

Posted by Gianny Damour <gi...@optusnet.com.au>.
On 28/07/2005 1:01 PM, Aaron Mulder wrote:

>On Wed, 27 Jul 2005, Jeremy Boynes wrote:
>  
>
>>I believe there are certain scenarios where multiple relationships can 
>>exist between a pair of entities and there is no other way to tell them 
>>apart.
>>    
>>
>
>	Well if this was true, then our code is broken, because it ignores 
>those fields.
>
>	But in truth, I believe that the cmr-field is unique -- it 
>wouldn't ever make sense to have the same cmr-field listed in more than 
>one relationship, right?  We currently require that at least one of the 
>ejb-relationship-roles in the ejb-relation includes a cmr-field, which I 
>think is also OK as how could you have relationship if neither side had a 
>CMR field?
>  
>
This was exactly my reasoning when this was implemented. At least one 
role defines a CMR field and based on this later and the role source we 
can infer the other one. BTW, this is why we need the 
foreign-key-column-on-source optional element...

Thanks,
Gianny

>Aaron
>
>
>  
>



Re: EJB Relationship Mapping Names

Posted by Aaron Mulder <am...@alumni.princeton.edu>.
On Wed, 27 Jul 2005, Jeremy Boynes wrote:
> I believe there are certain scenarios where multiple relationships can 
> exist between a pair of entities and there is no other way to tell them 
> apart.

	Well if this was true, then our code is broken, because it ignores 
those fields.

	But in truth, I believe that the cmr-field is unique -- it 
wouldn't ever make sense to have the same cmr-field listed in more than 
one relationship, right?  We currently require that at least one of the 
ejb-relationship-roles in the ejb-relation includes a cmr-field, which I 
think is also OK as how could you have relationship if neither side had a 
CMR field?

Aaron

Re: EJB Relationship Mapping Names

Posted by Jeremy Boynes <jb...@apache.org>.
Aaron Mulder wrote:
> 	What's the purpose of the ejb-relation-name and
> ejb-relationship-role-name elements at:
> 
> openejb-jar/relationships/ejb-relation/ejb-relation-name
> 
> openejb-jar/relationships/ejb-relation/ejb-relationship-role/
>                                        ejb-relationship-role-name
> 
> 	It seems that we ignore those, and don't validate them against
> each other even if they're present in both ejb-jar.xml and openejb-jar.xml
> (they're optional in both files).  I guess it could be used for
> "documentation", but then I'd prefer to make it a description element
> instead of something that looks like it ought to be present.
> 

I believe there are certain scenarios where multiple relationships can 
exist between a pair of entities and there is no other way to tell them 
apart.

--
Jeremy