Bugs item #514578, was opened at 2002-02-07 15:23
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=402704&aid=514578&group_id=31602

Category: ejbdoclet
Group: cvs
Status: Open
Resolution: Fixed
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
Assigned to: David Budworth (dbudworth)
Summary: cascade-delete

Initial Comment:
Hi

In the RelationTagsHandler.java, we have:

        public void ifLeftCascadeDelete( String 
template ) throws XDocletException
        {
                String cd = getMethodTagValue( 
currentRelation.getLeftMethod(), "ejb:target-
relation", "cascade-delete", 0, "yes,no", "no", 
false );

                if( "yes".equals( cd ) )
                        generate( template );
        }

        /**
         * Evaluates the body if the right side of 
this relation has
         * cascade-delete=yes, or the left side has 
target-relation
         * cascade-delete="yes"
         *
         * @param template              The body of 
the block tag
         * @exception XDocletException
         */
        public void ifRightCascadeDelete( String 
template ) throws XDocletException
        {
                String cd = null;

                if( isBidirectional() )
                        cd = getMethodTagValue( 
currentRelation.getRightMethod
(), "ejb:relation", "cascade-delete", 
0, "yes,no", "no", false );
                else
                        cd = getMethodTagValue( 
currentRelation.getLeftMethod(), "ejb:target-
relation", "cascade-delete", 0, "yes,no", "no", 
false );

                if( "yes".equals( cd ) )
                        generate( template );
        }

In a uni directional r'ship, the ifLeftCascadeDelete() 
and ifRightCascadeDelete() will return true, even if 
we only want the right to cascade delete. This can be 
fixed if we change 

                String cd = getMethodTagValue( 
currentRelation.getLeftMethod(), "ejb:target-
relation", "cascade-delete", 0, "yes,no", "no", 
false );
to 

                String cd = getMethodTagValue( 
currentRelation.getLeftMethod
(), "ejb:relation", "cascade-delete", 
0, "yes,no", "no", false );

I think it's a typo.

Keith

----------------------------------------------------------------------

Comment By: Keith Chew (keithcsl)
Date: 2002-02-07 19:34

Message:
Logged In: YES 
user_id=64163

I see that you have also fixed the other problem:
        public String rightEJBName() throws XDocletException
        {
                if( isBidirectional() )
                        return EjbTagsHandler.getEjbNameFor
( currentRelation.getRight() );
                else
                        return getMethodTagValue( 
currentRelation.getLeftMethod(), "ejb:relation", "target-
ejb", 0, null, null, true );
        }

used to be ejb:target-relation

Thanks. It's all working.

Keith

----------------------------------------------------------------------

Comment By: David Budworth (dbudworth)
Date: 2002-02-07 19:17

Message:
Logged In: YES 
user_id=343354

RelationTagsHandler.java 1.17 has the fix(hopefully)

Please test and close (or yell at me) depending on if it works.


----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=402704&aid=514578&group_id=31602

_______________________________________________
Xdoclet-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel

Reply via email to