User: dimc Date: 02/06/10 02:32:16 Modified: modules/ejb/src/xdoclet/modules/ejb/dd RelationTagsHandler.java Log: Uncommented what looks to be something that was commented out temporarily in the midst of the XJavadoc refactoring (the change to javabean compliance by the looks). Could someone please check that there isn't a reason this was still commented out? I found it was required in a uni-directional n-1 relationship otherwise the target-ejb params were ignored. Revision Changes Path 1.4 +24 -24 xdoclet/modules/ejb/src/xdoclet/modules/ejb/dd/RelationTagsHandler.java Index: RelationTagsHandler.java =================================================================== RCS file: /cvsroot/xdoclet/xdoclet/modules/ejb/src/xdoclet/modules/ejb/dd/RelationTagsHandler.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -w -r1.3 -r1.4 --- RelationTagsHandler.java 31 May 2002 20:43:57 -0000 1.3 +++ RelationTagsHandler.java 10 Jun 2002 09:32:16 -0000 1.4 @@ -30,7 +30,7 @@ * @author Ara Abrahamian ([EMAIL PROTECTED]) * @created Oct 15, 2001 * @xdoclet:taghandler namespace="EjbRel" - * @version $Revision: 1.3 $ + * @version $Revision: 1.4 $ */ public class RelationTagsHandler extends EjbTagsHandler { @@ -302,29 +302,29 @@ currentRelation = relationHolder; // Get the target-ejb value (null or not), so we can perform sanity checks. -// String target = relationHolder.getLeftMethod().doc().tagAttributeValue( "ejb:relation", "target-ejb" ); -// if( relationHolder.getRight() == null ) -// { -// // Relation has only been declared in one method. That means it is unidirectional and requires -// // target-ejb to be set. Perform the sanity check here before we give the template -// // a chance to do something stupid. -// -// if( target == null ) -// { -// throw new XDocletException( Translator.getString( XDocletModulesEjbMessages.class, XDocletModulesEjbMessages.RELATION_NEEDS_TARGET, -// new String[]{relationName, relationHolder.getLeft().name() + "." + relationHolder.getLeftMethod().name()} ) ); -// } -// } -// else -// { -// // Relation has been declared in exactly two methods. That means target-ejb is forbidden, since its -// // presence will result in invalid relations element in ejb-jar.xml -// if( target != null ) -// { -// throw new XDocletException( Translator.getString( XDocletModulesEjbMessages.class, XDocletModulesEjbMessages.RELATION_NEEDS_NO_TARGET, -// new String[]{relationName, relationHolder.getLeft().name() + "." + relationHolder.getLeftMethod().name()} ) ); -// } -// } + String target = null; + + if (relationHolder.getLeftMethod() != null && relationHolder.getLeftMethod().getDoc() != null) + target = relationHolder.getLeftMethod().getDoc().getTagAttributeValue("ejb:relation", "target-ejb"); + + if (relationHolder.getRight() == null) { + // Relation has only been declared in one method. That means it is unidirectional and requires + // target-ejb to be set. Perform the sanity check here before we give the template + // a chance to do something stupid. + + if (target == null) { + throw new XDocletException(Translator.getString(XDocletModulesEjbMessages.class, XDocletModulesEjbMessages.RELATION_NEEDS_TARGET, + new String[]{relationName, relationHolder.getLeft().getName() + "." + relationHolder.getLeftMethod().getName()})); + } + } + else { + // Relation has been declared in exactly two methods. That means target-ejb is forbidden, since its + // presence will result in invalid relations element in ejb-jar.xml + if (target != null) { + throw new XDocletException(Translator.getString(XDocletModulesEjbMessages.class, XDocletModulesEjbMessages.RELATION_NEEDS_NO_TARGET, + new String[]{relationName, relationHolder.getLeft().getName() + "." + relationHolder.getLeftMethod().getName()})); + } + } if (log.isDebugEnabled()) { log.debug("Generating template for Relation: " + currentRelation);
_______________________________________________________________ Don't miss the 2002 Sprint PCS Application Developer's Conference August 25-28 in Las Vegas - http://devcon.sprintpcs.com/adp/index.cfm?source=osdntextlink _______________________________________________ Xdoclet-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/xdoclet-devel