Hi,

I was just asking myself about some black hole in the understanding for me in WeblogicRelationTagsHandler.forAllColumnMap(). I pasted abstract of the code I didn't manage to understand and add comment to explain my point of vue. Thanks a lot for the time you can give to answer me.

public void forAllColumnMaps(String template, boolean left) throws XDocletException
{


       [...]

       if (methodA != null) {
           // bidirectional
           columnMapTags = methodA.getDoc().getTags("weblogic.column-map");

           columnMapTagIterator = XCollections.tagIterator(columnMapTags);
           pkClass = classB;

// **** How is it possible to have a pkClass (a classB) null as the relation is bidirectionnal ???
// **** Indeed, if you look at RelationHandler.forAllRelationships() you can see that
// **** if the relation is bidirectionnal :
// **** . the left side is always filled with the (1) side of the relationship
// **** . the right side with 1 or N
// **** for example if we've got | Actor | <--1---------------------------*--> | Contract |
// **** getContracts() getActor()


// **** | School | <--1---------------------------*---- | Teacher |
// **** null getSchool()


// **** | Person | ---1----------------------------1--> | Address |
// **** getAdress() null


// **** | PostCode | <--- 1 -------------------- 1 ---> | City |
// **** getCity() getPostCode()


// **** | Human | <--- 1 --------------------------- 1 ---- | Person |
// **** null getHuman() // **** how is it possible to have a pkClass == null ??? because a relation is always between two classes isn't it ???
if (pkClass == null) {
pkClass = EjbTagsHandler.getEjb(methodA.getDoc().getTagAttributeValue("ejb.relation", "target-ejb"));
}


if (columnMapTags.size() == 0) {
//throw new XDocletException( currentRelation.getRightMethod().name() + " should have at least one @weblogic:column-map tag (B)" );
}
}
else {
// unidirectional


// **** An unidirectionnal relation can be done from right side to left so why the test methodA == null is sufficient for deciding that the relation is unidirectionnal ???

columnMapTags = methodB.getDoc().getTags("weblogic:target-column-map");

columnMapTagIterator = XCollections.tagIterator(columnMapTags);
pkClass = classB;
if (columnMapTags.size() == 0) {
//throw new XDocletException( currentRelation.getLeftMethod().name() + " should have at least one @weblogic:target-column-map tag (C)" );
}
}


       while (columnMapTagIterator.hasNext()) {
           XTag columnMapTag = columnMapTagIterator.next();

currentKeyColumn = columnMapTag.getAttributeValue("key-column");
currentForeignKeyColumn = columnMapTag.getAttributeValue("foreign-key-column");
generate(template);
}
}


I am surely missing something but don't see what. Are the original comments valuable ?

   Denis.

PS : Currently, I am managing a XDoclet Plugin for managing WebSphere Deployment Descriptors for EJB CMP & Sessions (http://xdoclet-websphe.sourceforge.net). Hope it will be mergeable at the end of work :@)


-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
xdoclet-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel

Reply via email to