Update of /cvsroot/xdoclet/xdoclet/modules/hibernate/src/xdoclet/modules/hibernate
In directory sc8-pr-cvs1:/tmp/cvs-serv18414

Modified Files:
        HibernateSubTask.java HibernateTagsHandler.java 
Log Message:
generate role instead of name in Hibernate2

Index: HibernateSubTask.java
===================================================================
RCS file: 
/cvsroot/xdoclet/xdoclet/modules/hibernate/src/xdoclet/modules/hibernate/HibernateSubTask.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** HibernateSubTask.java       9 Mar 2003 04:04:41 -0000       1.4
--- HibernateSubTask.java       9 Mar 2003 22:34:13 -0000       1.5
***************
*** 84,88 ****
       * @return
       */
!     public String getVersion()
      {
          return hibernateVersion;
--- 84,88 ----
       * @return
       */
!     public String getVersionString()
      {
          return hibernateVersion;
***************
*** 143,147 ****
      {
          public final static String HIBERNATE_1_1 = "1.1";
- 
          public final static String HIBERNATE_2_0 = "2.0";
  
--- 143,146 ----

Index: HibernateTagsHandler.java
===================================================================
RCS file: 
/cvsroot/xdoclet/xdoclet/modules/hibernate/src/xdoclet/modules/hibernate/HibernateTagsHandler.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** HibernateTagsHandler.java   9 Mar 2003 04:04:41 -0000       1.8
--- HibernateTagsHandler.java   9 Mar 2003 22:34:13 -0000       1.9
***************
*** 84,87 ****
--- 84,98 ----
  
      /**
+      * Get the attribute used for collection property names in this version of 
Hibernate (ie. "role" or "name")
+      *
+      * @param attributes
+      * @return
+      */
+     public String roleAttribute(Properties attributes)
+     {
+         return "1.1".equals(getHibernateSubTask().getVersionString()) ? "role" : 
"name";
+     }
+ 
+     /**
       * render template if ID is composite
       *
***************
*** 176,180 ****
  
              if (clazz.getDoc().hasTag("hibernate.class", false)) {
!                 mappingName = ((HibernateSubTask) 
(DocletContext.getInstance().getSubTaskBy(DocletTask.getSubTaskName(HibernateSubTask.class)))).getMappingURL(clazz);
                  sb.append(mappingName);
                  sb.append(",");
--- 187,191 ----
  
              if (clazz.getDoc().hasTag("hibernate.class", false)) {
!                 mappingName = getHibernateSubTask().getMappingURL(clazz);
                  sb.append(mappingName);
                  sb.append(",");
***************
*** 189,192 ****
--- 200,209 ----
      }
  
+     /**
+      * Print the name of the current class to the console
+      *
+      * @param attributes
+      * @exception XDocletException
+      */
      public void logMapping(Properties attributes) throws XDocletException
      {
***************
*** 328,331 ****
--- 345,354 ----
              setCurrentClass(oldClass);
          //TODO: Why do we need this!!??
+     }
+ 
+     private HibernateSubTask getHibernateSubTask()
+     {
+         return ((HibernateSubTask) (DocletContext.getInstance()
+             .getSubTaskBy(DocletTask.getSubTaskName(HibernateSubTask.class))));
      }
  



-------------------------------------------------------
This SF.net email is sponsored by: Etnus, makers of TotalView, The debugger 
for complex code. Debugging C/C++ programs can leave you feeling lost and 
disoriented. TotalView can help you find your way. Available on major UNIX 
and Linux platforms. Try it free. www.etnus.com
_______________________________________________
xdoclet-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel

Reply via email to