Update of /cvsroot/xdoclet/xdoclet/modules/ejb/src/xdoclet/modules/ejb/entity
In directory 
sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22508/modules/ejb/src/xdoclet/modules/ejb/entity

Modified Files:
        PkTagsHandler.java PersistentTagsHandler.java 
Log Message:
don't generate a compound primary key if only one cmp-field is marked with 
ejb.primkey-field (XDT-1139)

Index: PkTagsHandler.java
===================================================================
RCS file: 
/cvsroot/xdoclet/xdoclet/modules/ejb/src/xdoclet/modules/ejb/entity/PkTagsHandler.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -r1.15 -r1.16
*** PkTagsHandler.java  29 Apr 2003 19:14:47 -0000      1.15
--- PkTagsHandler.java  9 Apr 2005 16:31:43 -0000       1.16
***************
*** 33,40 ****
  {
      /**
!      * @param clazz  The class to look into
!      * @return       The value of the ejb:bean primkey-field parameter
       */
!     public static String getPrimkeyFieldFor(XClass clazz)
      {
          // the primkey-field may be specified in a super class, so check them 
as well
--- 33,41 ----
  {
      /**
!      * @param clazz                 The class to look into
!      * @return                      The value of the ejb:bean primkey-field 
parameter
!      * @exception XDocletException
       */
!     public static String getPrimkeyFieldFor(XClass clazz) throws 
XDocletException
      {
          // the primkey-field may be specified in a super class, so check them 
as well
***************
*** 42,45 ****
--- 43,54 ----
          String pkField = clazz.getDoc().getTagAttributeValue("ejb:bean", 
"primkey-field", true);
  
+         if (pkField == null) {
+             // search for a single ejb.pk-field tag
+             String fields = PersistentTagsHandler.fieldList(clazz, 
"ejb:pk-field", null, 3, null, true);
+ 
+             if (fields.length() > 0 && fields.indexOf(",") < 0) {
+                 pkField = fields;
+             }
+         }
          return pkField;
      }

Index: PersistentTagsHandler.java
===================================================================
RCS file: 
/cvsroot/xdoclet/xdoclet/modules/ejb/src/xdoclet/modules/ejb/entity/PersistentTagsHandler.java,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -r1.22 -r1.23
*** PersistentTagsHandler.java  8 Feb 2005 22:02:05 -0000       1.22
--- PersistentTagsHandler.java  9 Apr 2005 16:31:44 -0000       1.23
***************
*** 134,138 ****
       * @param exclTag               Fields that don't have all of the tags of 
this comma-separated list are used.
       * @param type                  Type of return (0: comma separated list - 
1: field=value comma separated list - 2:
!      *      getter comma sperated list)
       * @param clazz                 Description of Parameter
       * @param valueObject
--- 134,138 ----
       * @param exclTag               Fields that don't have all of the tags of 
this comma-separated list are used.
       * @param type                  Type of return (0: comma separated list - 
1: field=value comma separated list - 2:
!      *      getter comma sperated list, 3: comma separated name list)
       * @param clazz                 Description of Parameter
       * @param valueObject
***************
*** 198,201 ****
--- 198,207 ----
                              st.append(method.getName()).append("()");
                              break;
+                         case 3:
+                             if (foundFields.size() > 1) {
+                                 st.append(',');
+                             }
+                             st.append(name);
+                             break;
                          }
                      }



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
xdoclet-devel mailing list
xdoclet-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel

Reply via email to