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

Modified Files:
        FactoryClassSubTask.java HibernateTagsHandler.java 
Log Message:
Updates for FactoryClass to generate correct code for use with JNDI data sources

Index: FactoryClassSubTask.java
===================================================================
RCS file: 
/cvsroot/xdoclet/xdoclet/modules/hibernate/src/xdoclet/modules/hibernate/FactoryClassSubTask.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** FactoryClassSubTask.java    5 Aug 2003 09:33:24 -0000       1.2
--- FactoryClassSubTask.java    15 Jan 2004 18:39:19 -0000      1.3
***************
*** 12,17 ****
  import xdoclet.util.Translator;
  /**
!  * Generate a SessionFactory facade that is capable of configuring Hibernate inline, 
as well
!  * as provide a convenient method of switching later to other SessionFactory 
implementations.
   *
   * @author        Brian Topping ([EMAIL PROTECTED])
--- 12,17 ----
  import xdoclet.util.Translator;
  /**
!  * Generate a SessionFactory facade that is capable of configuring Hibernate inline, 
as well as provide a convenient
!  * method of switching later to other SessionFactory implementations.
   *
   * @author        Brian Topping ([EMAIL PROTECTED])
***************
*** 39,42 ****
--- 39,43 ----
      private String  password;
      private String  factoryClass;
+     private boolean useJndiFactory = false;
  
      /**
***************
*** 81,84 ****
--- 82,90 ----
      }
  
+     public boolean isUseJndiFactory()
+     {
+         return useJndiFactory;
+     }
+ 
      /**
       * The data source name to be generated into the factory
***************
*** 141,144 ****
--- 147,159 ----
      }
  
+     /**
+      * @param useJndiFactory
+      * @ant.not-required      No. Default is false.
+      */
+     public void setUseJndiFactory(boolean useJndiFactory)
+     {
+         this.useJndiFactory = useJndiFactory;
+     }
+ 
  
      public void validateOptions() throws XDocletException

Index: HibernateTagsHandler.java
===================================================================
RCS file: 
/cvsroot/xdoclet/xdoclet/modules/hibernate/src/xdoclet/modules/hibernate/HibernateTagsHandler.java,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -r1.23 -r1.24
*** HibernateTagsHandler.java   8 Aug 2003 07:56:58 -0000       1.23
--- HibernateTagsHandler.java   15 Jan 2004 18:39:19 -0000      1.24
***************
*** 193,196 ****
--- 193,228 ----
       * @doc.tag                     type="block"
       */
+     public void ifUseJndiFactory(String template, Properties attributes) throws 
XDocletException
+     {
+         if (getFactoryClassSubTask().isUseJndiFactory()) {
+             generate(template);
+         }
+     }
+ 
+     /**
+      * Render template if jndiName of JBossServiceSubtask is valid. This is a 
required parameter, but the user might not
+      * be using that subtask.
+      *
+      * @param template
+      * @param attributes
+      * @exception XDocletException
+      * @doc.tag                     type="block"
+      */
+     public void ifNotUseJndiFactory(String template, Properties attributes) throws 
XDocletException
+     {
+         if (!getFactoryClassSubTask().isUseJndiFactory()) {
+             generate(template);
+         }
+     }
+ 
+     /**
+      * Render template if jndiName of JBossServiceSubtask is valid. This is a 
required parameter, but the user might not
+      * be using that subtask.
+      *
+      * @param template
+      * @param attributes
+      * @exception XDocletException
+      * @doc.tag                     type="block"
+      */
      public void ifHasJndiName(String template, Properties attributes) throws 
XDocletException
      {
***************
*** 217,220 ****
--- 249,256 ----
              generate(template);
          }
+         if (factoryDialect() != null
+             && jndiName() != null) {
+             generate(template);
+         }
      }
  



-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
xdoclet-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel

Reply via email to