User: rinkrank
Date: 02/03/24 14:35:51
Modified: core/src/xdoclet/ejb/tags/vendor
WeblogicRelationTagsHandler.java
Log:
Fixed some bugs in relations. At least on WLS it now supports all combinations of
cardinality and directionality. I'm afraid this has broken JBoss support for CMP, but
wasn't it broken anyway?
Revision Changes Path
1.9 +33 -1
xdoclet/core/src/xdoclet/ejb/tags/vendor/WeblogicRelationTagsHandler.java
Index: WeblogicRelationTagsHandler.java
===================================================================
RCS file:
/cvsroot/xdoclet/xdoclet/core/src/xdoclet/ejb/tags/vendor/WeblogicRelationTagsHandler.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -w -r1.8 -r1.9
--- WeblogicRelationTagsHandler.java 24 Mar 2002 17:44:18 -0000 1.8
+++ WeblogicRelationTagsHandler.java 24 Mar 2002 22:35:51 -0000 1.9
@@ -12,7 +12,7 @@
/**
* @author <a href="mailto:[EMAIL PROTECTED]">Aslak Helles�y</a>
* @created Sept 11, 2001
- * @version $Revision: 1.8 $
+ * @version $Revision: 1.9 $
*/
public class WeblogicRelationTagsHandler extends RelationTagsHandler
{
@@ -74,6 +74,38 @@
currentForeignKeyColumn = columnMapTags[i].attributeValue(
"foreign-key-column" );
currentKeyColumn = columnMapTags[i].attributeValue(
"key-column" );
generate( template );
+ }
+ }
+
+ /**
+ * Makes sure the column-map tags are on the right side
+ */
+ public void ensureColumnMapTagsRight() {
+ // Before this methd is executed, we might have:
+ // 1(fk) <-> 1(pk)
+ // 1(fk) --> 1(pk)
+ // 1(fk) <-- 1(pk)
+ // m (column-map, target-column-map) <-- n
+ //
+ // make sure it's
+ // 1(pk) <-> 1(fk)
+ // 1(pk) --> 1(fk)
+ // 1(pk) <-- 1(fk)
+ // m <-- n (column-map, target-column-map)
+
+ boolean leftHasTargetColumnMapTags = false;
+ boolean rightHasColumnMapTags = false;
+ if( currentRelation.getLeftMethod() != null ) {
+
System.out.println("LEFT:"+currentRelation.getLeftMethod().name());
+ leftHasTargetColumnMapTags =
currentRelation.getLeftMethod().doc().tags("weblogic:target-column-map").length != 0;
+ }
+ if( currentRelation.getRightMethod() != null ) {
+
System.out.println("RIGHT:"+currentRelation.getRightMethod().name());
+ rightHasColumnMapTags =
currentRelation.getRightMethod().doc().tags("weblogic:column-map").length != 0;
+ }
+ if( leftHasTargetColumnMapTags || rightHasColumnMapTags ) {
+ System.out.println("SWAP");
+ currentRelation.swap();
}
}
_______________________________________________
Xdoclet-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel