Index: project.xml
===================================================================
--- project.xml	(revision 165338)
+++ project.xml	(working copy)
@@ -23,7 +23,7 @@
   <pomVersion>3</pomVersion>
   <id>maven-hibernate-plugin</id>
   <name>Maven Hibernate Plug-in</name>
-  <currentVersion>1.3</currentVersion>
+  <currentVersion>1.4</currentVersion>
   <description/>
   <shortDescription>Work with Hibernate classes</shortDescription>
   <url>http://maven.apache.org/reference/plugins/hibernate/</url>
@@ -93,19 +93,13 @@
     </contributor>
   </contributors>
   <dependencies>
+  <!--
+   Hibernate needs to _not_ be in the plugin
+   dependency classpath. Which ever version is
+   set as a project dependency will be used.
+   for the plugin actions.
+  -->
     <dependency>
-      <groupId>hibernate</groupId>
-      <artifactId>hibernate</artifactId>
-      <version>2.1.3</version>
-      <type>jar</type>
-    </dependency>
-    <dependency>
-      <groupId>hibernate</groupId>
-      <artifactId>hibernate-tools</artifactId>
-      <version>2.1.3</version>
-      <type>jar</type>
-    </dependency>
-    <dependency>
       <groupId>ant</groupId>
       <artifactId>ant</artifactId>
       <version>1.5.3-1</version>
Index: src/main/org/apache/maven/hibernate/HibernateEntityResolver.java
===================================================================
--- src/main/org/apache/maven/hibernate/HibernateEntityResolver.java	(revision 165338)
+++ src/main/org/apache/maven/hibernate/HibernateEntityResolver.java	(working copy)
@@ -45,10 +45,12 @@
 
     /** list of j2ee dtds that are being made available */
     public static final String[] HIBERNATE_DTDS = new String[] {
-        "-//Hibernate/Hibernate Mapping DTD 2.0//EN"
+        "-//Hibernate/Hibernate Mapping DTD 2.0//EN",
+        "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
         };
     public static final String[] HIBERNATE_RESOURCES = new String[] {
-        "/plugin-resources/hibernate-mapping-2.0.dtd"
+        "/plugin-resources/hibernate-mapping-2.0.dtd",
+        "/plugin-resources/hibernate-mapping-3.0.dtd"
         };
 
     /** Creates a new instance of EntityResolver */
Index: src/main/org/apache/maven/hibernate/beans/SchemaBeanBase.java
===================================================================
--- src/main/org/apache/maven/hibernate/beans/SchemaBeanBase.java	(revision 165338)
+++ src/main/org/apache/maven/hibernate/beans/SchemaBeanBase.java	(working copy)
@@ -21,8 +21,7 @@
 import java.net.URL;
 import java.net.URLClassLoader;
 
-import net.sf.hibernate.HibernateException;
-import net.sf.hibernate.cfg.Configuration;
+import org.apache.maven.hibernate.HibernateVersions;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -127,64 +126,73 @@
    public void execute() throws Exception
    {
 
-      Thread currentThread = Thread.currentThread();
-      ClassLoader oldClassLoader = currentThread.getContextClassLoader();
-      try
-      {
-  	    File [] baseDirs = getBaseDirs ();
-  	    URL  [] urls = new URL [baseDirs.length];
-  	    for (int i = 0; i < urls.length; i++) { 
-  		    urls [i] = baseDirs [i].toURL ();
-  	    }
-  	
-        URLClassLoader newClassLoader =
-          new URLClassLoader(urls, getClass().getClassLoader());
-        currentThread.setContextClassLoader(newClassLoader);
-    
-        Configuration cfg = getConfiguration();        
-        executeSchema( cfg );
+       Thread currentThread = Thread.currentThread();
+       ClassLoader oldClassLoader = currentThread.getContextClassLoader();
+       try
+       {
+           File[] baseDirs = getBaseDirs();
+           URL[] urls = new URL[baseDirs.length];
+           for (int i = 0; i < urls.length; i++)
+           {
+               urls[i] = baseDirs[i].toURL();
+           }
 
-      }
-      finally
-      {
-         currentThread.setContextClassLoader(oldClassLoader);
-      }
+           URLClassLoader newClassLoader =
+               new URLClassLoader(urls, getClass().getClassLoader());
+           currentThread.setContextClassLoader(newClassLoader);
+
+           //equiv: Configuration cfg = getConfiguration();
+           Object cfg = getConfiguration();
+           executeSchema(cfg);
+
+       }
+       finally
+       {
+           currentThread.setContextClassLoader(oldClassLoader);
+       }
    }
 
    /**
    * Method that does the real job
    */
-  protected abstract void executeSchema(Configuration cfg) throws Exception;
+  protected abstract void executeSchema(Object cfg) throws Exception;
 
-  /**
-    * 
-    */
-   private Configuration getConfiguration() throws HibernateException
-   {
-      Configuration cfg = new Configuration();
-      if (getConfig() != null)
-      {      	
-      	 File f = new File(getConfig());
-      	 LOG.debug("Hibernate Configuration File: " + f.getAbsolutePath());
-         cfg.configure(f);
-      }
+    /**
+     *
+     */
+    private Object getConfiguration() throws RuntimeException
+    {
+        HibernateVersions hbv = HibernateVersions.getInstance();
+        //equiv: Configuration cfg = new Configuration();
+        Object cfg = hbv.newConfiguration();
 
-      String[] files = getFileNames ();
-      for (int i = 0; i < files.length; i++)
-      {
-         String filename = files[i];
-         if (filename.endsWith(".jar"))
-         {
-            cfg.addJar(filename);
-         }
-         else
-         {
-            cfg.addFile(filename);
-         }
-      }
-      return cfg;
-   }
+        if (getConfig() != null)
+        {
+            File f = new File(getConfig());
+            LOG.debug("Hibernate Configuration File: " + f.getAbsolutePath());
+            //equiv: cfg.configure(f);
+            hbv.configure(cfg, f);
+        }
 
+        String[] files = getFileNames();
+        for (int i = 0; i < files.length; i++)
+        {
+            String filename = files[i];
+            if (filename.endsWith(".jar"))
+            {
+                //equiv: cfg.addJar( filename | new File(filename) );
+                hbv.addJar(cfg, filename);
+            }
+            else
+            {
+                //equiv: cfg.addFile(filename);
+                hbv.addFile(cfg, filename);
+            }
+        }
+        return cfg;
+    }
+
+
   private String schemaOutputFile = null;
   private String delimiter = null;
 
Index: src/main/org/apache/maven/hibernate/beans/MappingsAggregatorBean.java
===================================================================
--- src/main/org/apache/maven/hibernate/beans/MappingsAggregatorBean.java	(revision 165338)
+++ src/main/org/apache/maven/hibernate/beans/MappingsAggregatorBean.java	(working copy)
@@ -103,6 +103,8 @@
         String docType = current.getDocType().getText();
         if(docType == null || "".equals(docType.trim()))
             return "";
+        if(docType.indexOf("hibernate-mapping-3.0.dtd") > 0)
+            return "3.0";
         if(docType.indexOf("hibernate-mapping-2.0.dtd") > 0)
             return "2.0";
         if(docType.indexOf("hibernate-mapping-1.1.dtd") > 0)
Index: src/main/org/apache/maven/hibernate/beans/SchemaExportBean.java
===================================================================
--- src/main/org/apache/maven/hibernate/beans/SchemaExportBean.java	(revision 165338)
+++ src/main/org/apache/maven/hibernate/beans/SchemaExportBean.java	(working copy)
@@ -20,8 +20,7 @@
 import java.io.FileInputStream;
 import java.util.Properties;
 
-import net.sf.hibernate.cfg.Configuration;
-import net.sf.hibernate.tool.hbm2ddl.SchemaExport;
+import org.apache.maven.hibernate.HibernateVersions;
 
 /**
  * 
@@ -51,30 +50,37 @@
    {
       drop = b;
    }
-   
-   protected void executeSchema(Configuration cfg) throws Exception {
-      SchemaExport schemaExport = null;
-      if (getProperties() == null)
-      {
-         schemaExport = new SchemaExport(cfg);
-      }
-      else
-      {
-         Properties properties = new Properties();
-         properties.load(new FileInputStream(getProperties()));
-         schemaExport = new SchemaExport(cfg, properties);
-      }
-      LOG.debug("Output file:" + getOutputFile());
-      schemaExport.setOutputFile(getOutputFile());
-      schemaExport.setDelimiter(getDelimiter());
-      if (isDrop())
-      {
-          schemaExport.drop(!getQuiet(), !getText());
-      } 
-      else
-      {
-          schemaExport.create(!getQuiet(), !getText());
-      }
+
+    protected void executeSchema(Object cfg) throws Exception
+    {
+        HibernateVersions hbv = HibernateVersions.getInstance();
+        //equiv: SchemaExport schemaExport = null;
+        Object schemaExport = null;
+        if (getProperties() == null)
+        {
+            //equiv: schemaExport = new SchemaExport(cfg);
+            schemaExport = hbv.newSchemaExport(cfg);
+        }
+        else
+        {
+            Properties properties = new Properties();
+            properties.load(new FileInputStream(getProperties()));
+            //equiv: schemaExport = new SchemaExport(cfg, properties);
+            schemaExport = hbv.newSchemaExport(cfg, properties);
+        }
+        //equiv: schemaExport.setOutputFile(getOutputFile());
+        hbv.setOutputFile(schemaExport, getOutputFile());
+        //equiv: schemaExport.setDelimiter(getDelimiter());
+        hbv.setDelimiter(schemaExport, getDelimiter());
+        if (isDrop())
+        {
+            //equiv: schemaExport.drop(!getQuiet(), !getText());
+            hbv.drop(schemaExport, !getQuiet(), !getText());
+        }
+        else
+        {
+            //equiv: schemaExport.create(!getQuiet(), !getText());
+            hbv.create(schemaExport, !getQuiet(), !getText());
+        }
     }
-   
 }
Index: src/main/org/apache/maven/hibernate/beans/SchemaUpdateBean.java
===================================================================
--- src/main/org/apache/maven/hibernate/beans/SchemaUpdateBean.java	(revision 165338)
+++ src/main/org/apache/maven/hibernate/beans/SchemaUpdateBean.java	(working copy)
@@ -17,15 +17,14 @@
  * ====================================================================
  */
 
+import org.apache.maven.hibernate.HibernateVersions;
+
 import java.io.FileInputStream;
 import java.util.Properties;
 
-import net.sf.hibernate.cfg.Configuration;
-import net.sf.hibernate.tool.hbm2ddl.SchemaUpdate;
-
 /**
  * 
- * The Bean which serves as Proxy To Hibernate SchemaUpdate 
+ * The Bean which serves as Proxy To Hibernate SchemaUpdate
  * <br/>
  *   
  * @author <a href="maven@felipeal.net">Felipe Leme</a> 
@@ -33,20 +32,26 @@
  */
 public class SchemaUpdateBean extends SchemaBeanBase
 {
-   
-   protected void executeSchema(Configuration cfg) throws Exception {
-      SchemaUpdate schemaUpdate = null;
-      if (getProperties() == null)
-      {
-         schemaUpdate = new SchemaUpdate(cfg);
-      }
-      else
-      {
-         Properties properties = new Properties();
-         properties.load(new FileInputStream(getProperties()));
-         schemaUpdate = new SchemaUpdate(cfg, properties);
-      }
-      schemaUpdate.execute( !getQuiet(), !getText() );
+
+    protected void executeSchema(Object cfg) throws Exception
+    {
+        HibernateVersions hbv = HibernateVersions.getInstance();
+        //equiv: SchemaUpdate schemaUpdate = null;
+        Object schemaUpdate = null;
+        if (getProperties() == null)
+        {
+            //equiv: schemaUpdate = new SchemaUpdate(cfg);
+            schemaUpdate = hbv.newSchemaUpdate(cfg);
+        }
+        else
+        {
+            Properties properties = new Properties();
+            properties.load(new FileInputStream(getProperties()));
+            //equiv: schemaUpdate = new SchemaUpdate(cfg, properties);
+            schemaUpdate = hbv.newSchemaUpdate(cfg, properties);
+        }
+        //equiv: schemaUpdate.execute( !getQuiet(), !getText() );
+        hbv.execute(schemaUpdate, !getQuiet(), !getText());
     }
-   
+
 }
Index: src/main/org/apache/maven/hibernate/beans/CodeGenerationBean.java
===================================================================
--- src/main/org/apache/maven/hibernate/beans/CodeGenerationBean.java	(revision 165338)
+++ src/main/org/apache/maven/hibernate/beans/CodeGenerationBean.java	(working copy)
@@ -17,45 +17,52 @@
  * ====================================================================
  */
 
-import net.sf.hibernate.tool.hbm2java.CodeGenerator;
+import org.apache.maven.hibernate.HibernateVersions;
 
 /**
  * @author <a href="paulkearney@gmail.com">Paul Kearney</a> 
  * @version $Id$
  */
-public class CodeGenerationBean extends CommonOperationsBean {
-    
+public class CodeGenerationBean extends SchemaBeanBase
+{
+
     private static final String OUTPUT_SWITCH = "--output=";
-    
+
     private String outputdir = null;
-    
-    public void execute() {
-        
-        // Construct output directory argument    
-        StringBuffer switchArg= new StringBuffer();
+
+    public void executeSchema(Object cfg)
+    {
+        HibernateVersions hbv = HibernateVersions.getInstance();
+
+        // Construct output directory argument
+        StringBuffer switchArg = new StringBuffer();
         switchArg.append(OUTPUT_SWITCH).append(getOutputdir());
-        
+
         // Get list of files that are to be used to generate POJOs
         final String[] files = getFileNames();
-        
+
         // Require new array to combine command args with hbm files array
-        String[] args  = new String[files.length + 1];
+        String[] args = new String[files.length + 1];
         // Add command arg to new array
         args[0] = switchArg.toString();
         // Copy list of hbm files to new array
         System.arraycopy(files, 0, args, 1, files.length);
-                        
+
         // Generate POJOs
-        CodeGenerator generator = new CodeGenerator(); 
-        generator.main(args);  
-        
-    }    
-    
-    public String getOutputdir() {
+        //equiv: CodeGenerator generator = new CodeGenerator();
+        Object generator = hbv.newCodeGenerator();
+        //equiv: generator.main(args);
+        hbv.main(generator, args);
+    }
+
+
+    public String getOutputdir()
+    {
         return this.outputdir;
     }
-        
-    public void setOutputdir(String outputdir) {        
+
+    public void setOutputdir(String outputdir)
+    {
         this.outputdir = outputdir;
-    }    
+    }
 }
Index: src/main/org/apache/maven/hibernate/HibernateVersions.java
===================================================================
--- src/main/org/apache/maven/hibernate/HibernateVersions.java	(revision 0)
+++ src/main/org/apache/maven/hibernate/HibernateVersions.java	(revision 0)
@@ -0,0 +1,464 @@
+package org.apache.maven.hibernate;
+
+/* ====================================================================
+ *   Copyright 2001-2004 The Apache Software Foundation.
+ *
+ *   Licensed under the Apache License, Version 2.0 (the "License");
+ *   you may not use this file except in compliance with the License.
+ *   You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *   See the License for the specific language governing permissions and
+ *   limitations under the License.
+ * ====================================================================
+ */
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import java.io.File;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.lang.reflect.Constructor;
+import java.util.Properties;
+
+/**
+ * A class to provide all the reflection tools needed to implement
+ * a multi-version Hiberate plugin.
+ *
+ * @author Anthony Vito
+ * @version $Id$
+ */
+public class HibernateVersions
+{
+    /**
+     * log for debug output
+     */
+    private static final Log LOG = LogFactory.getLog( HibernateVersions.class );
+
+    public static HibernateVersions getInstance()
+    {
+        ClassLoader cctxloader = Thread.currentThread().getContextClassLoader();
+        return new HibernateVersions( cctxloader );
+    }
+
+    private static final String V2PREFIX = "net.sf.";
+    private static final String V3PREFIX = "org.";
+    private boolean v3;
+    private String prefix;
+
+    /* Some storage of common classes and methods for easy access */
+    /* First, the configuration object */
+    private Class configurationCls;
+    private Method configureMethod, addJarMethod, addFileMethod;
+    private Method getPropertiesMethod;
+    /* The SchemaExport object */
+    private Class schemaExportCls;
+    private Constructor schemaExportConstr_cfg, schemaExportConstr_cfg_props;
+    private Method setOutputFileMethod, setDelimiterMethod, dropMethod, createMethod;
+    /* The SchemaUpdate object */
+    private Class schemaUpdateCls;
+    private Constructor schemaUpdateConstr_cfg, schemaUpdateConstr_cfg_props;
+    private Method executeMethod;
+
+    /* The 2.X code generator stuff */
+    private Class codegeneratorCls;
+    private Method mainMethod;
+
+    /**
+     * Determine on class load what hiberate version we have on the classpath.
+     * This is a maven plugin and in maven only one version per artifactId can
+     * be a depenedency. Therefore only one hiberate version will be in the
+     * class. Figure out which one, and set the version.
+     */
+    private HibernateVersions( ClassLoader loader )
+    {
+        boolean netsf = false;
+        try
+        {
+            Class.forName( "net.sf.hibernate.cfg.Configuration" );
+            netsf = true;
+        }
+        catch ( Exception ignored ) { }
+        boolean orghb = false;
+        try
+        {
+            Class.forName( "org.hibernate.cfg.Configuration" );
+            orghb = true;
+        }
+        catch ( Exception ignored ) { }
+        if ( !( netsf || orghb ) )
+        {
+            throw new RuntimeException( "Hibernate version 2.X or 3.X Required For Hibernate Plugin!" );
+        }
+        if ( orghb )
+        {
+            v3 = true;
+            prefix = V3PREFIX;
+        }
+        else
+        {
+            v3 = false;
+            prefix = V2PREFIX;
+        }
+
+        // set up the classes and methods we will need
+        try
+        {
+            // Configuration Class
+            configurationCls = Class.forName( prefix + "hibernate.cfg.Configuration", true, loader );
+            configureMethod = configurationCls.getMethod( "configure", new Class[]{File.class} );
+            if ( v3 )
+                addJarMethod = configurationCls.getMethod( "addJar", new Class[]{File.class} );
+            else
+                addJarMethod = configurationCls.getMethod( "addJar", new Class[]{String.class} );
+            addFileMethod = configurationCls.getMethod( "addFile", new Class[]{String.class} );
+            getPropertiesMethod = configurationCls.getMethod( "getProperties", new Class[]{} );
+
+            // Schema Export Class
+            schemaExportCls = Class.forName( prefix + "hibernate.tool.hbm2ddl.SchemaExport", true, loader );
+            schemaExportConstr_cfg = schemaExportCls.getConstructor( new Class[]{configurationCls} );
+            schemaExportConstr_cfg_props = schemaExportCls.getConstructor( new Class[]{configurationCls, Properties.class} );
+            setOutputFileMethod = schemaExportCls.getMethod( "setOutputFile", new Class[]{String.class} );
+            setDelimiterMethod = schemaExportCls.getMethod( "setDelimiter", new Class[]{String.class} );
+            dropMethod = schemaExportCls.getMethod( "drop", new Class[]{Boolean.TYPE, Boolean.TYPE} );
+            createMethod = schemaExportCls.getMethod( "create", new Class[]{Boolean.TYPE, Boolean.TYPE} );
+
+            // Schema Update Class
+            schemaUpdateCls = Class.forName( prefix + "hibernate.tool.hbm2ddl.SchemaUpdate", true, loader );
+            schemaUpdateConstr_cfg = schemaUpdateCls.getConstructor( new Class[]{configurationCls} );
+            schemaUpdateConstr_cfg_props = schemaUpdateCls.getConstructor( new Class[]{configurationCls, Properties.class} );
+            executeMethod = schemaUpdateCls.getMethod( "execute", new Class[]{Boolean.TYPE, Boolean.TYPE} );
+        }
+        catch ( NoSuchMethodException e )
+        {
+            throw new RuntimeException( e );
+        }
+        catch ( ClassNotFoundException e )
+        {
+            throw new RuntimeException( e );
+        }
+
+        try
+        {
+            codegeneratorCls = Class.forName( "net.sf.hibernate.tool.hbm2java.CodeGenerator", true, loader );
+            mainMethod = codegeneratorCls.getMethod( "main", new Class[]{String[].class} );
+        }
+        catch ( ClassNotFoundException e )
+        {
+            LOG.debug( "No version 2.X tools on classpath. No CodeGenerator Available" );
+        }
+        catch ( NoSuchMethodException e )
+        {
+            throw new RuntimeException( e );
+        }
+    }
+
+    public boolean v3()
+    {
+        return v3;
+    }
+
+    public Object newConfiguration()
+    {
+        Object cfg = null;
+        try
+        {
+            cfg = configurationCls.newInstance();
+            LOG.debug( "HBVClassLoader == " + Thread.currentThread().getContextClassLoader().toString() );
+        }
+        catch ( IllegalAccessException e )
+        {
+            throw new RuntimeException();
+        }
+        catch ( InstantiationException e )
+        {
+            throw new RuntimeException( e );
+        }
+        return cfg;
+    }
+
+    public void configure( Object configuration, File file )
+    {
+        try
+        {
+            configureMethod.invoke( configuration, new Object[]{file} );
+        }
+        catch ( IllegalAccessException e )
+        {
+            throw new RuntimeException( e );
+        }
+        catch ( InvocationTargetException e )
+        {
+            handleTargetMakeNiceMessage( e );
+            throw new RuntimeException( e.getCause() );
+        }
+    }
+
+    public void addJar( Object configuration, String filename )
+    {
+        try
+        {
+            if ( v3 )
+                addJarMethod.invoke( configuration, new Object[]{new File( filename )} );
+            else
+                addJarMethod.invoke( configuration, new Object[]{filename} );
+        }
+        catch ( IllegalAccessException e )
+        {
+            throw new RuntimeException( e );
+        }
+        catch ( InvocationTargetException e )
+        {
+            handleTargetMakeNiceMessage( e );
+            throw new RuntimeException( e.getCause() );
+        }
+    }
+
+    public void addFile( Object configuration, String filename )
+    {
+        try
+        {
+            addFileMethod.invoke( configuration, new Object[]{filename} );
+        }
+        catch ( IllegalAccessException e )
+        {
+            throw new RuntimeException( e );
+        }
+        catch ( InvocationTargetException e )
+        {
+            handleTargetMakeNiceMessage( e );
+            throw new RuntimeException( e.getCause() );
+        }
+    }
+
+    public Object newSchemaExport( Object configuration, Properties props )
+    {
+        Object schemaExport = null;
+        try
+        {
+            if ( props == null )
+            {
+                schemaExport = schemaExportConstr_cfg.newInstance( new Object[]{configuration} );
+            }
+            else
+            {
+                schemaExport = schemaExportConstr_cfg_props.newInstance( new Object[]{configuration, props} );
+            }
+        }
+        catch ( IllegalAccessException e )
+        {
+            throw new RuntimeException( e );
+        }
+        catch ( InstantiationException e )
+        {
+            throw new RuntimeException( e );
+        }
+        catch ( InvocationTargetException e )
+        {
+            handleTargetMakeNiceMessage( e );
+            throw new RuntimeException( e.getCause() );
+        }
+        return schemaExport;
+    }
+
+    public Object newSchemaExport( Object configuration )
+    {
+        return newSchemaExport( configuration, null );
+    }
+
+    public void setOutputFile( Object schemaExport, String outputfile )
+    {
+        try
+        {
+            setOutputFileMethod.invoke( schemaExport, new Object[]{outputfile} );
+        }
+        catch ( IllegalAccessException e )
+        {
+            throw new RuntimeException( e );
+        }
+        catch ( InvocationTargetException e )
+        {
+            handleTargetMakeNiceMessage( e );
+            throw new RuntimeException( e.getCause() );
+        }
+    }
+
+    public void setDelimiter( Object schemaExport, String delim )
+    {
+        try
+        {
+            setDelimiterMethod.invoke( schemaExport, new Object[]{delim} );
+        }
+        catch ( IllegalAccessException e )
+        {
+            throw new RuntimeException( e );
+        }
+        catch ( InvocationTargetException e )
+        {
+            handleTargetMakeNiceMessage( e );
+            throw new RuntimeException( e.getCause() );
+        }
+    }
+
+    public void drop( Object schemaExport, boolean quiet, boolean text )
+    {
+        try
+        {
+            dropMethod.invoke( schemaExport, new Object[]{new Boolean( quiet ), new Boolean( text )} );
+        }
+        catch ( IllegalAccessException e )
+        {
+            throw new RuntimeException( e );
+        }
+        catch ( InvocationTargetException e )
+        {
+            handleTargetMakeNiceMessage( e );
+            throw new RuntimeException( e.getCause() );
+        }
+    }
+
+    public void create( Object schemaExport, boolean quiet, boolean text )
+    {
+        try
+        {
+            createMethod.invoke( schemaExport, new Object[]{new Boolean( quiet ), new Boolean( text )} );
+        }
+        catch ( IllegalAccessException e )
+        {
+            throw new RuntimeException( e );
+        }
+        catch ( InvocationTargetException e )
+        {
+            handleTargetMakeNiceMessage( e );
+            throw new RuntimeException( e.getCause() );
+        }
+    }
+
+    public Object newSchemaUpdate( Object configuration, Properties props )
+    {
+        Object schemaUpdate = null;
+        try
+        {
+            if ( props == null )
+            {
+                schemaUpdate = schemaUpdateConstr_cfg.newInstance( new Object[]{configuration} );
+            }
+            else
+            {
+                schemaUpdate = schemaUpdateConstr_cfg_props.newInstance( new Object[]{configuration, props} );
+            }
+        }
+        catch ( IllegalAccessException e )
+        {
+            throw new RuntimeException( e );
+        }
+        catch ( InstantiationException e )
+        {
+            throw new RuntimeException( e );
+        }
+        catch ( InvocationTargetException e )
+        {
+            handleTargetMakeNiceMessage( e );
+            throw new RuntimeException( e.getCause() );
+        }
+        return schemaUpdate;
+    }
+
+    public void execute( Object schemaUpdate, boolean quiet, boolean text )
+    {
+        try
+        {
+            executeMethod.invoke( schemaUpdate, new Object[]{new Boolean( quiet ), new Boolean( text )} );
+        }
+        catch ( IllegalAccessException e )
+        {
+            throw new RuntimeException( e );
+        }
+        catch ( InvocationTargetException e )
+        {
+            handleTargetMakeNiceMessage( e );
+            throw new RuntimeException( e.getCause() );
+        }
+    }
+
+    public Object newSchemaUpdate( Object configuration )
+    {
+        return newSchemaUpdate( configuration, null );
+    }
+
+    public Object newCodeGenerator()
+    {
+        if ( codegeneratorCls == null ) return null;
+        Object generator = null;
+        try
+        {
+            generator = codegeneratorCls.newInstance();
+        }
+        catch ( IllegalAccessException e )
+        {
+            throw new RuntimeException( e );
+        }
+        catch ( InstantiationException e )
+        {
+            throw new RuntimeException( e );
+        }
+        return generator;
+    }
+
+    public void main( Object generator, String[] args )
+    {
+        try
+        {
+            mainMethod.invoke( generator, new Object[]{args} );
+        }
+        catch ( IllegalAccessException e )
+        {
+            throw new RuntimeException( e );
+        }
+        catch ( InvocationTargetException e )
+        {
+            handleTargetMakeNiceMessage( e );
+            throw new RuntimeException( e.getCause() );
+        }
+    }
+
+
+    public void printProperties( Object cfg )
+    {
+        try
+        {
+            Object properties = getPropertiesMethod.invoke( cfg, new Object[]{} );
+            Properties props = ( Properties ) properties;
+            System.out.println( "----Configuration Properties---" );
+            props.list( System.out );
+            System.out.println( "-------------------------------" );
+        }
+        catch ( IllegalAccessException e )
+        {
+            throw new RuntimeException( e );
+        }
+        catch ( InvocationTargetException e )
+        {
+            handleTargetMakeNiceMessage( e );
+            throw new RuntimeException( e.getCause() );
+        }
+    }
+
+    private void handleTargetMakeNiceMessage( InvocationTargetException e )
+    {
+        Throwable cause = e.getCause();
+        if ( cause.getClass().getName().endsWith( "HibernateException" ) )
+        {
+            LOG.fatal( "A Hibernate Exception Has Occurred." );
+            if ( cause.getMessage().indexOf( "class not found" ) != -1 )
+            {
+                LOG.fatal( "Are You Using The Corrected Hibernate Version? Current is " + ( v3 ? "3.X" : "2.X" ) );
+            }
+        }
+    }
+}
Index: src/plugin-resources/hibernate-mapping-3.0.dtd
===================================================================
--- src/plugin-resources/hibernate-mapping-3.0.dtd	(revision 0)
+++ src/plugin-resources/hibernate-mapping-3.0.dtd	(revision 0)
@@ -0,0 +1,911 @@
+<!-- Hibernate Mapping DTD.
+
+<!DOCTYPE hibernate-mapping PUBLIC 
+    "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+An instance of this XML document may contain mappings for an arbitrary 
+number of classes. The class mappings may contain associations to classes
+mapped in the same document or in another document. No class may be 
+mapped more than once. Each document may also contain definitions of an
+arbitrary number of queries, and import declarations of arbitrary classes. 
+
+-->
+
+<!--
+	The document root.
+ -->
+
+<!ELEMENT hibernate-mapping (
+	meta*, 
+	typedef*, 
+	import*, 
+	(class|subclass|joined-subclass)*,
+	(query|sql-query)*, 
+	filter-def*
+)>
+	<!ATTLIST hibernate-mapping schema CDATA #IMPLIED>									<!-- default: none -->
+	<!ATTLIST hibernate-mapping catalog CDATA #IMPLIED>									<!-- default: none -->
+	<!ATTLIST hibernate-mapping default-cascade CDATA "none">
+	<!ATTLIST hibernate-mapping default-access CDATA "property">
+	<!ATTLIST hibernate-mapping default-lazy (true|false) "true">
+	<!ATTLIST hibernate-mapping auto-import (true|false) "true">
+	<!ATTLIST hibernate-mapping package CDATA #IMPLIED>									<!-- default: none -->
+
+<!--
+	META element definition; used to assign meta-level attributes to a class
+	or property.  Is currently used by codegenerator as a placeholder for
+	values that is not directly related to OR mappings.
+-->
+<!ELEMENT meta (#PCDATA)>
+	<!ATTLIST meta attribute CDATA #REQUIRED>
+	<!ATTLIST meta inherit (true|false) "true">
+
+<!--
+	TYPEDEF element definition; defines a new name for a Hibernate type. May
+	contain parameters for parameterizable types.
+-->
+<!ELEMENT typedef (param*)>
+	<!ATTLIST typedef class CDATA #REQUIRED>
+	<!ATTLIST typedef name CDATA #REQUIRED>
+
+<!--
+	IMPORT element definition; an explicit query language "import"
+-->
+<!ELEMENT import EMPTY>
+	<!ATTLIST import class CDATA #REQUIRED>
+	<!ATTLIST import rename CDATA #IMPLIED>	<!-- default: unqualified class name -->
+
+<!--
+	Root entity mapping.  Poorly named as entities do not have to be represented by 
+	classes at all.  Mapped entities may be represented via different methodologies 
+	(POJO, Map, Dom4j).
+-->
+<!ELEMENT class (
+ 	meta*,
+	subselect?,
+	cache?,
+	synchronize*,
+	(id|composite-id),
+	discriminator?,
+	(version|timestamp)?,
+	(property|many-to-one|one-to-one|component|dynamic-component|properties|any|map|set|list|bag|idbag|array|primitive-array|query-list)*,
+	((join*,subclass*)|joined-subclass*|union-subclass*),
+	loader?,sql-insert?,sql-update?,sql-delete?,
+	filter*
+)>
+	<!ATTLIST class entity-name CDATA #IMPLIED>
+	<!ATTLIST class name CDATA #IMPLIED>                            <!-- this is the class name -->
+	<!ATTLIST class proxy CDATA #IMPLIED>							<!-- default: no proxy interface -->
+	<!ATTLIST class lazy (true|false) #IMPLIED>
+	<!ATTLIST class table CDATA #IMPLIED>							<!-- default: unqualified classname -->
+	<!ATTLIST class schema CDATA #IMPLIED>							<!-- default: none -->
+	<!ATTLIST class catalog CDATA #IMPLIED>							<!-- default: none -->
+	<!ATTLIST class subselect CDATA #IMPLIED>
+	<!ATTLIST class discriminator-value CDATA #IMPLIED>				<!-- default: unqualified class name | none -->
+	<!ATTLIST class mutable (true|false) "true">
+	<!ATTLIST class abstract (true|false) "false">
+	<!ATTLIST class polymorphism (implicit|explicit) "implicit">
+	<!ATTLIST class where CDATA #IMPLIED>							<!-- default: none -->
+	<!ATTLIST class persister CDATA #IMPLIED>
+	<!ATTLIST class dynamic-update (true|false) "false">
+	<!ATTLIST class dynamic-insert (true|false) "false">
+	<!ATTLIST class batch-size CDATA #IMPLIED>
+	<!ATTLIST class select-before-update (true|false) "false">
+	<!ATTLIST class optimistic-lock (none|version|dirty|all) "version">
+	<!ATTLIST class check CDATA #IMPLIED>							<!-- default: none -->
+	<!ATTLIST class rowid CDATA #IMPLIED>
+	<!ATTLIST class node CDATA #IMPLIED>
+
+
+<!--
+	FILTER-DEF element; top-level filter definition.
+-->
+<!ELEMENT filter-def (filter-param*)>
+	<!ATTLIST filter-def name CDATA #REQUIRED> <!-- The filter name -->
+
+<!--
+	FILTER-PARAM element; qualifies parameters found within a FILTER-DEF
+	condition.
+-->
+<!ELEMENT filter-param EMPTY>
+	<!ATTLIST filter-param name CDATA #REQUIRED> <!-- The parameter name -->
+	<!ATTLIST filter-param type CDATA #REQUIRED> <!-- The parameter type -->
+
+<!--
+	FILTER element; used to apply a filter.
+-->
+<!ELEMENT filter (#PCDATA)>
+	<!ATTLIST filter name CDATA #REQUIRED>
+	<!ATTLIST filter condition CDATA #IMPLIED>
+
+
+<!-- A join allows some properties of a class to be persisted to a second table -->
+
+<!ELEMENT join ( 
+	subselect?,
+	key,
+	(property|many-to-one|component|dynamic-component|any)*,
+	sql-insert?,sql-update?,sql-delete?
+)>
+	<!ATTLIST join table CDATA #REQUIRED>
+	<!ATTLIST join schema CDATA #IMPLIED>						<!-- default: none -->
+	<!ATTLIST join catalog CDATA #IMPLIED>						<!-- default: none -->
+	<!ATTLIST join subselect CDATA #IMPLIED>
+	<!ATTLIST join fetch (join|select) "join">
+	<!ATTLIST join inverse (true|false) "false">
+	<!ATTLIST join optional (true|false) "false">
+
+<!-- Declares the id type, column and generation algorithm for an entity class.
+If a name attribut is given, the id is exposed to the application through the 
+named property of the class. If not, the id is only exposed to the application 
+via Session.getIdentifier() -->
+
+<!ELEMENT id (meta*, column*, generator?)>
+	<!ATTLIST id name CDATA #IMPLIED>
+	<!ATTLIST id node CDATA #IMPLIED>
+	<!ATTLIST id access CDATA #IMPLIED>
+	<!ATTLIST id column CDATA #IMPLIED>
+	<!ATTLIST id type CDATA #IMPLIED>
+	<!ATTLIST id length CDATA #IMPLIED>
+	<!ATTLIST id unsaved-value CDATA #IMPLIED>					<!-- any|none|null|undefined|0|-1|... -->
+
+<!-- A composite key may be modelled by a java class with a property for each 
+key column. The class must implement java.io.Serializable and reimplement equals() 
+and hashCode(). -->
+
+<!ELEMENT composite-id ( meta*, (key-property|key-many-to-one)+ )>
+	<!ATTLIST composite-id class CDATA #IMPLIED>
+	<!ATTLIST composite-id name CDATA #IMPLIED>
+	<!ATTLIST composite-id node CDATA #IMPLIED>
+	<!ATTLIST composite-id access CDATA #IMPLIED>
+	<!ATTLIST composite-id unsaved-value (undefined|any|none) "undefined"> 
+
+<!-- Polymorphic data requires a column holding a class discriminator value. This
+value is not directly exposed to the application. -->
+
+<!ELEMENT discriminator ((column|formula)?)>
+	<!ATTLIST discriminator column CDATA #IMPLIED>				<!-- default: "class"|none -->
+	<!ATTLIST discriminator formula CDATA #IMPLIED>
+	<!ATTLIST discriminator type CDATA "string">
+	<!ATTLIST discriminator not-null (true|false) "true">
+	<!ATTLIST discriminator length CDATA #IMPLIED>
+	<!ATTLIST discriminator force (true|false) "false">
+	<!ATTLIST discriminator insert (true|false) "true">
+	
+<!-- Versioned data requires a column holding a version number. This is exposed to the
+application through a property of the Java class. -->
+
+<!ELEMENT version (meta*)>
+	<!ATTLIST version name CDATA #REQUIRED>
+	<!ATTLIST version node CDATA #IMPLIED>
+	<!ATTLIST version access CDATA #IMPLIED>
+	<!ATTLIST version column CDATA #IMPLIED>
+	<!ATTLIST version type CDATA "integer">
+	<!ATTLIST version unsaved-value (null|negative|undefined) "undefined">
+
+<!ELEMENT timestamp (meta*)>
+	<!ATTLIST timestamp name CDATA #REQUIRED>
+	<!ATTLIST timestamp node CDATA #IMPLIED>
+	<!ATTLIST timestamp column CDATA #IMPLIED>
+	<!ATTLIST timestamp access CDATA #IMPLIED>
+	<!ATTLIST timestamp unsaved-value (null|undefined) "null">
+
+
+<!--
+	Subclass declarations are nested beneath the root class declaration to achieve
+	polymorphic persistence with the table-per-hierarchy mapping strategy.
+
+	See the note on the class element regarding <pojo/> vs. @name usage...
+-->
+<!ELEMENT subclass (
+ 	meta*,
+	synchronize*,
+	(property|many-to-one|one-to-one|component|dynamic-component|any|map|set|list|bag|idbag|array|primitive-array|query-list)*,
+	join*, 
+	subclass*,
+	loader?,sql-insert?,sql-delete?,sql-update?
+)>
+	<!ATTLIST subclass entity-name CDATA #IMPLIED>
+	<!ATTLIST subclass name CDATA #IMPLIED>
+	<!ATTLIST subclass proxy CDATA #IMPLIED>							<!-- default: no proxy interface -->
+	<!ATTLIST subclass discriminator-value CDATA #IMPLIED>				<!-- default: unqualified class name | none -->
+	<!ATTLIST subclass dynamic-update (true|false) "false">
+	<!ATTLIST subclass dynamic-insert (true|false) "false">
+	<!ATTLIST subclass select-before-update (true|false) "false">
+	<!ATTLIST subclass extends CDATA #IMPLIED>							<!-- default: empty when a toplevel, otherwise the nearest class definition -->
+	<!ATTLIST subclass lazy (true|false) #IMPLIED>
+	<!ATTLIST subclass abstract (true|false) "false">
+	<!ATTLIST subclass persister CDATA #IMPLIED>
+	<!ATTLIST subclass batch-size CDATA #IMPLIED>
+	<!ATTLIST subclass node CDATA #IMPLIED>
+
+<!--
+	Joined subclasses are used for the normalized table-per-subclass mapping strategy
+
+	See the note on the class element regarding <pojo/> vs. @name usage...
+-->
+<!ELEMENT joined-subclass (
+	meta*,
+	subselect?,
+	synchronize*,
+	key,
+	(property|many-to-one|one-to-one|component|dynamic-component|any|map|set|list|bag|idbag|array|primitive-array|query-list)*, 
+	joined-subclass*,
+	loader?,sql-insert?,sql-update?,sql-delete?
+)>
+	<!ATTLIST joined-subclass entity-name CDATA #IMPLIED>
+	<!ATTLIST joined-subclass name CDATA #IMPLIED>
+	<!ATTLIST joined-subclass proxy CDATA #IMPLIED>				 		<!-- default: no proxy interface -->
+	<!ATTLIST joined-subclass table CDATA #IMPLIED>				 		<!-- default: unqualified class name -->
+	<!ATTLIST joined-subclass schema CDATA #IMPLIED>
+	<!ATTLIST joined-subclass catalog CDATA #IMPLIED>
+	<!ATTLIST joined-subclass subselect CDATA #IMPLIED>
+	<!ATTLIST joined-subclass dynamic-update (true|false) "false">
+	<!ATTLIST joined-subclass dynamic-insert (true|false) "false">
+	<!ATTLIST joined-subclass select-before-update (true|false) "false">
+	<!ATTLIST joined-subclass extends CDATA #IMPLIED>			 		<!-- default: none when toplevel, otherwise the nearest class definition -->
+	<!ATTLIST joined-subclass lazy (true|false) #IMPLIED>
+	<!ATTLIST joined-subclass abstract (true|false) "false">
+	<!ATTLIST joined-subclass persister CDATA #IMPLIED>
+	<!ATTLIST joined-subclass check CDATA #IMPLIED>				 		<!-- default: none -->
+	<!ATTLIST joined-subclass batch-size CDATA #IMPLIED>
+	<!ATTLIST joined-subclass node CDATA #IMPLIED>
+
+<!--
+	Union subclasses are used for the table-per-concrete-class mapping strategy
+
+	See the note on the class element regarding <pojo/> vs. @name usage...
+-->
+<!ELEMENT union-subclass (
+ 	meta*,
+	subselect?,
+	synchronize*,
+	(property|many-to-one|one-to-one|component|dynamic-component|any|map|set|list|bag|idbag|array|primitive-array|query-list)*,
+	union-subclass*,
+	loader?,sql-insert?,sql-update?,sql-delete?
+)>
+	<!ATTLIST union-subclass entity-name CDATA #IMPLIED>
+	<!ATTLIST union-subclass name CDATA #IMPLIED>
+	<!ATTLIST union-subclass proxy CDATA #IMPLIED>						<!-- default: no proxy interface -->
+	<!ATTLIST union-subclass table CDATA #IMPLIED>						<!-- default: unqualified class name -->
+	<!ATTLIST union-subclass schema CDATA #IMPLIED>
+	<!ATTLIST union-subclass catalog CDATA #IMPLIED>
+	<!ATTLIST union-subclass subselect CDATA #IMPLIED>
+	<!ATTLIST union-subclass dynamic-update (true|false) "false">
+	<!ATTLIST union-subclass dynamic-insert (true|false) "false">
+	<!ATTLIST union-subclass select-before-update (true|false) "false">
+	<!ATTLIST union-subclass extends CDATA #IMPLIED>					<!-- default: none when toplevel, otherwise the nearest class definition -->
+	<!ATTLIST union-subclass lazy (true|false) #IMPLIED>
+	<!ATTLIST union-subclass abstract (true|false) "false">
+	<!ATTLIST union-subclass persister CDATA #IMPLIED>
+	<!ATTLIST union-subclass check CDATA #IMPLIED>						<!-- default: none -->
+	<!ATTLIST union-subclass batch-size CDATA #IMPLIED>
+	<!ATTLIST union-subclass node CDATA #IMPLIED>
+
+<!-- Property of an entity class or component, component-element, composite-id, etc. 
+JavaBeans style properties are mapped to table columns. -->
+
+<!ELEMENT property (meta*,(column|formula)*,type?)>
+	<!ATTLIST property name CDATA #REQUIRED>
+	<!ATTLIST property node CDATA #IMPLIED>
+	<!ATTLIST property access CDATA #IMPLIED>
+	<!ATTLIST property type CDATA #IMPLIED>
+	<!ATTLIST property column CDATA #IMPLIED>
+	<!ATTLIST property length CDATA #IMPLIED>
+	<!ATTLIST property precision CDATA #IMPLIED>
+	<!ATTLIST property scale CDATA #IMPLIED>
+	<!ATTLIST property not-null (true|false) "false">
+	<!ATTLIST property unique (true|false) "false">
+	<!ATTLIST property update (true|false) "true">
+	<!ATTLIST property insert (true|false) "true">
+	<!ATTLIST property optimistic-lock (true|false) "true">	<!-- only supported for properties of a class (not component) -->
+	<!ATTLIST property formula CDATA #IMPLIED>
+	<!ATTLIST property index CDATA #IMPLIED>				<!-- include the columns spanned by this property in an index -->
+	<!ATTLIST property lazy (true|false) "false">
+
+<!-- Declares the type of the containing property (overrides an eventually existing type
+attribute of the property). May contain param elements to customize a ParametrizableType. -->
+<!ELEMENT type (param*)>
+	<!ATTLIST type name CDATA #REQUIRED>
+	
+<!-- Declares an association between two entities (Or from a component, component element,
+etc. to an entity). -->
+
+<!ELEMENT many-to-one (meta*,(column|formula)*)>
+	<!ATTLIST many-to-one name CDATA #REQUIRED>
+	<!ATTLIST many-to-one access CDATA #IMPLIED>
+	<!ATTLIST many-to-one class CDATA #IMPLIED>
+	<!ATTLIST many-to-one entity-name CDATA #IMPLIED>
+	<!ATTLIST many-to-one column CDATA #IMPLIED>
+	<!ATTLIST many-to-one not-null (true|false) "false">
+	<!ATTLIST many-to-one unique (true|false) "false">
+	<!ATTLIST many-to-one cascade CDATA #IMPLIED>
+	<!ATTLIST many-to-one outer-join (true|false|auto) #IMPLIED>
+	<!ATTLIST many-to-one fetch (join|select) #IMPLIED>
+	<!ATTLIST many-to-one update (true|false) "true">
+	<!ATTLIST many-to-one insert (true|false) "true">
+	<!ATTLIST many-to-one optimistic-lock (true|false) "true">	<!-- only supported for properties of a class (not component) -->
+	<!ATTLIST many-to-one foreign-key CDATA #IMPLIED>
+	<!ATTLIST many-to-one property-ref CDATA #IMPLIED>
+	<!ATTLIST many-to-one formula CDATA #IMPLIED>
+	<!ATTLIST many-to-one index CDATA #IMPLIED>				 	<!-- include the columns spanned by this association in an index -->
+	<!ATTLIST many-to-one lazy (true|false) "false">
+	<!ATTLIST many-to-one node CDATA #IMPLIED>
+	<!ATTLIST many-to-one embed-xml (true|false) "true">
+	
+<!-- Declares a one-to-one association between two entities (Or from a component, 
+component element, etc. to an entity). -->
+
+<!ELEMENT one-to-one (meta*|formula*)>
+	<!ATTLIST one-to-one name CDATA #REQUIRED>
+	<!ATTLIST one-to-one formula CDATA #IMPLIED>
+	<!ATTLIST one-to-one access CDATA #IMPLIED>
+	<!ATTLIST one-to-one class CDATA #IMPLIED>
+	<!ATTLIST one-to-one entity-name CDATA #IMPLIED>
+	<!ATTLIST one-to-one cascade CDATA #IMPLIED>
+	<!ATTLIST one-to-one outer-join (true|false|auto) #IMPLIED>
+	<!ATTLIST one-to-one fetch (join|select) #IMPLIED>
+	<!ATTLIST one-to-one constrained (true|false) "false">
+	<!ATTLIST one-to-one foreign-key CDATA #IMPLIED>
+	<!ATTLIST one-to-one property-ref CDATA #IMPLIED>
+	<!ATTLIST one-to-one lazy (true|false) "false">
+	<!ATTLIST one-to-one node CDATA #IMPLIED>
+	<!ATTLIST one-to-one embed-xml (true|false) "true">
+	
+<!-- A property embedded in a composite identifier or map index (always not-null). -->
+
+<!ELEMENT key-property (meta*,column*)>
+	<!ATTLIST key-property name CDATA #REQUIRED>
+	<!ATTLIST key-property access CDATA #IMPLIED>
+	<!ATTLIST key-property type CDATA #IMPLIED>
+	<!ATTLIST key-property column CDATA #IMPLIED>
+	<!ATTLIST key-property length CDATA #IMPLIED>
+
+<!-- A many-to-one association embedded in a composite identifier or map index 
+(always not-null, never cascade). -->
+
+<!ELEMENT key-many-to-one (meta*,column*)>
+	<!ATTLIST key-many-to-one name CDATA #REQUIRED>
+	<!ATTLIST key-many-to-one access CDATA #IMPLIED>
+	<!ATTLIST key-many-to-one class CDATA #IMPLIED>
+	<!ATTLIST key-many-to-one entity-name CDATA #IMPLIED>
+	<!ATTLIST key-many-to-one column CDATA #IMPLIED>
+	<!ATTLIST key-many-to-one foreign-key CDATA #IMPLIED>
+
+<!-- An "any" association is a polymorphic association to any table with
+the given identifier type. The first listed column is a VARCHAR column 
+holding the name of the class (for that row). -->
+
+<!ELEMENT any (meta*,meta-value*,column,column+)>
+	<!ATTLIST any id-type CDATA #REQUIRED>
+	<!ATTLIST any meta-type CDATA #IMPLIED>			 	<!--- default: Hibernate.STRING -->
+	<!ATTLIST any name CDATA #REQUIRED>
+	<!ATTLIST any access CDATA #IMPLIED>
+	<!ATTLIST any insert (true|false) "true">
+	<!ATTLIST any update (true|false) "true">
+	<!ATTLIST any cascade CDATA #IMPLIED>
+	<!ATTLIST any index CDATA #IMPLIED>					<!-- include the columns spanned by this association in an index -->
+	<!ATTLIST any optimistic-lock (true|false) "true">	<!-- only supported for properties of a class (not component) -->
+	<!ATTLIST any lazy (true|false) "false">
+	<!ATTLIST any node CDATA #IMPLIED>
+	
+<!ELEMENT meta-value EMPTY>
+	<!ATTLIST meta-value value CDATA #REQUIRED>
+	<!ATTLIST meta-value class CDATA #REQUIRED>
+
+<!-- A component is a user-defined class, persisted along with its containing entity
+to the table of the entity class. JavaBeans style properties of the component are
+mapped to columns of the table of the containing entity. A null component reference
+is mapped to null values in all columns and vice versa. Components do not support
+shared reference semantics. -->
+
+<!ELEMENT component (
+	meta*,
+	parent?,
+	(property|many-to-one|one-to-one|component|dynamic-component|any|map|set|list|bag|array|primitive-array)*
+)>
+	<!ATTLIST component class CDATA #IMPLIED>
+	<!ATTLIST component name CDATA #REQUIRED>
+	<!ATTLIST component access CDATA #IMPLIED>
+	<!ATTLIST component unique (true|false) "false">
+	<!ATTLIST component update (true|false) "true">
+	<!ATTLIST component insert (true|false) "true">
+	<!ATTLIST component lazy (true|false) "false">
+	<!ATTLIST component optimistic-lock (true|false) "true">
+	<!ATTLIST component node CDATA #IMPLIED>
+	
+<!-- A dynamic-component maps columns of the database entity to a java.util.Map 
+at the Java level -->
+
+<!ELEMENT dynamic-component (
+	(property|many-to-one|one-to-one|component|dynamic-component|any|map|set|list|bag|array|primitive-array)*
+)>
+	<!ATTLIST dynamic-component name CDATA #REQUIRED>
+	<!ATTLIST dynamic-component access CDATA #IMPLIED>
+	<!ATTLIST dynamic-component unique (true|false) "false">
+	<!ATTLIST dynamic-component update (true|false) "true">
+	<!ATTLIST dynamic-component insert (true|false) "true">
+	<!ATTLIST dynamic-component optimistic-lock (true|false) "true">
+	<!ATTLIST dynamic-component node CDATA #IMPLIED>
+
+<!-- properties declares that the contained properties form an alternate key. The name
+attribute allows an alternate key to be used as the target of a property-ref. -->
+
+<!ELEMENT properties (
+	(property|many-to-one|component|dynamic-component)*
+)>
+	<!ATTLIST properties name CDATA #REQUIRED>
+	<!ATTLIST properties unique (true|false) "false">
+	<!ATTLIST properties insert (true|false) "true">
+	<!ATTLIST properties update (true|false) "true">
+	<!ATTLIST properties optimistic-lock (true|false) "true">
+	<!ATTLIST properties node CDATA #IMPLIED>
+	
+<!-- The parent element maps a property of the component class as a pointer back to
+the owning entity. -->
+
+<!ELEMENT parent EMPTY>
+	<!ATTLIST parent name CDATA #REQUIRED>
+
+<!-- Collection declarations nested inside a class declaration indicate a foreign key 
+relationship from the collection table to the enclosing class. -->
+
+<!ELEMENT map (
+	meta*,
+	subselect?,
+	cache?,
+	synchronize*,
+	key, 
+	(map-key|composite-map-key|map-key-many-to-many|index|composite-index|index-many-to-many|index-many-to-any), 
+	(element|one-to-many|many-to-many|composite-element|many-to-any),
+	loader?,sql-insert?,sql-update?,sql-delete?,sql-delete-all?,
+	filter*
+)>
+	<!ATTLIST map name CDATA #REQUIRED>
+	<!ATTLIST map access CDATA #IMPLIED>
+	<!ATTLIST map table CDATA #IMPLIED>																<!-- default: name -->
+	<!ATTLIST map schema CDATA #IMPLIED>															<!-- default: none -->
+	<!ATTLIST map subselect CDATA #IMPLIED>
+	<!ATTLIST map catalog CDATA #IMPLIED>															<!-- default: none -->
+	<!ATTLIST map lazy (true|false) #IMPLIED>
+	<!ATTLIST map inverse (true|false) "false">
+	<!ATTLIST map sort CDATA "unsorted">														 	<!-- unsorted|natural|"comparator class", default: unsorted -->
+	<!ATTLIST map cascade CDATA #IMPLIED>
+	<!ATTLIST map order-by CDATA #IMPLIED>													 		<!-- default: none -->
+	<!ATTLIST map where CDATA #IMPLIED>																<!-- default: none -->
+	<!ATTLIST map batch-size CDATA #IMPLIED>
+	<!ATTLIST map outer-join (true|false|auto) #IMPLIED>
+	<!ATTLIST map fetch (join|select) #IMPLIED>
+	<!ATTLIST map check CDATA #IMPLIED>																<!-- default: none -->	
+	<!ATTLIST map persister CDATA #IMPLIED>														
+	<!ATTLIST map collection-type CDATA #IMPLIED>	
+	<!ATTLIST map optimistic-lock (true|false) "true">		<!-- only supported for properties of a class (not component) -->
+	<!ATTLIST map node CDATA #IMPLIED>
+	<!ATTLIST map embed-xml (true|false) "true">
+	
+<!ELEMENT set (
+	meta*,
+	subselect?,
+	cache?,
+	synchronize*,
+	key, 
+	(element|one-to-many|many-to-many|composite-element|many-to-any),
+	loader?,sql-insert?,sql-update?,sql-delete?,sql-delete-all?,
+	filter*
+)>
+	<!ATTLIST set name CDATA #REQUIRED>
+	<!ATTLIST set access CDATA #IMPLIED>
+	<!ATTLIST set table CDATA #IMPLIED>																<!-- default: name -->
+	<!ATTLIST set schema CDATA #IMPLIED>															<!-- default: none -->
+	<!ATTLIST set catalog CDATA #IMPLIED>															<!-- default: none -->
+	<!ATTLIST set subselect CDATA #IMPLIED>
+	<!ATTLIST set lazy (true|false) #IMPLIED>
+	<!ATTLIST set sort CDATA "unsorted">														 	<!-- unsorted|natural|"comparator class" -->
+	<!ATTLIST set inverse (true|false) "false">
+	<!ATTLIST set cascade CDATA #IMPLIED>
+	<!ATTLIST set order-by CDATA #IMPLIED>													 		<!-- default: none -->
+	<!ATTLIST set where CDATA #IMPLIED>																<!-- default: none -->
+	<!ATTLIST set batch-size CDATA #IMPLIED>
+	<!ATTLIST set outer-join (true|false|auto) #IMPLIED>
+	<!ATTLIST set fetch (join|select) #IMPLIED>
+	<!ATTLIST set persister CDATA #IMPLIED>	
+	<!ATTLIST set collection-type CDATA #IMPLIED>														
+	<!ATTLIST set check CDATA #IMPLIED>																<!-- default: none -->
+	<!ATTLIST set optimistic-lock (true|false) "true">		<!-- only supported for properties of a class (not component) -->
+	<!ATTLIST set node CDATA #IMPLIED>
+	<!ATTLIST set embed-xml (true|false) "true">
+
+<!ELEMENT bag (
+	meta*,
+	subselect?,
+	cache?,
+	synchronize*,
+	key, 
+	(element|one-to-many|many-to-many|composite-element|many-to-any),
+	loader?,sql-insert?,sql-update?,sql-delete?,sql-delete-all?,
+	filter*
+)>
+	<!ATTLIST bag name CDATA #REQUIRED>
+	<!ATTLIST bag access CDATA #IMPLIED>
+	<!ATTLIST bag table CDATA #IMPLIED>																<!-- default: name -->
+	<!ATTLIST bag schema CDATA #IMPLIED>															<!-- default: none -->
+	<!ATTLIST bag catalog CDATA #IMPLIED>															<!-- default: none -->
+	<!ATTLIST bag subselect CDATA #IMPLIED>
+	<!ATTLIST bag lazy (true|false) #IMPLIED>
+	<!ATTLIST bag inverse (true|false) "false">
+	<!ATTLIST bag cascade CDATA #IMPLIED>
+	<!ATTLIST bag order-by CDATA #IMPLIED>													 		<!-- default: none -->
+	<!ATTLIST bag where CDATA #IMPLIED>																<!-- default: none -->
+	<!ATTLIST bag batch-size CDATA #IMPLIED>
+	<!ATTLIST bag outer-join (true|false|auto) #IMPLIED>
+	<!ATTLIST bag fetch (join|select) #IMPLIED>
+	<!ATTLIST bag persister CDATA #IMPLIED>															
+	<!ATTLIST bag collection-type CDATA #IMPLIED>	
+	<!ATTLIST bag check CDATA #IMPLIED>																<!-- default: none -->
+	<!ATTLIST bag optimistic-lock (true|false) "true">		<!-- only supported for properties of a class (not component) -->
+	<!ATTLIST bag node CDATA #IMPLIED>
+	<!ATTLIST bag embed-xml (true|false) "true">
+
+<!ELEMENT idbag (
+	meta*,
+	subselect?,
+	cache?,
+	synchronize*,
+	collection-id,
+	key, 
+	(element|many-to-many|composite-element|many-to-any),
+	loader?,sql-insert?,sql-update?,sql-delete?,sql-delete-all?,
+	filter*
+)>
+	<!ATTLIST idbag name CDATA #REQUIRED>
+	<!ATTLIST idbag access CDATA #IMPLIED>
+	<!ATTLIST idbag table CDATA #IMPLIED>															<!-- default: name -->
+	<!ATTLIST idbag schema CDATA #IMPLIED>														 	<!-- default: none -->
+	<!ATTLIST idbag catalog CDATA #IMPLIED>															<!-- default: none -->
+	<!ATTLIST idbag subselect CDATA #IMPLIED>
+	<!ATTLIST idbag lazy (true|false) #IMPLIED>
+	<!ATTLIST idbag cascade CDATA #IMPLIED>
+	<!ATTLIST idbag order-by CDATA #IMPLIED>													 	<!-- default: none -->
+	<!ATTLIST idbag where CDATA #IMPLIED>															<!-- default: none -->
+	<!ATTLIST idbag batch-size CDATA #IMPLIED>
+	<!ATTLIST idbag outer-join (true|false|auto) #IMPLIED>
+	<!ATTLIST idbag fetch (join|select) #IMPLIED>
+	<!ATTLIST idbag persister CDATA #IMPLIED>															
+	<!ATTLIST idbag collection-type CDATA #IMPLIED>
+	<!ATTLIST idbag check CDATA #IMPLIED>															<!-- default: none -->
+	<!ATTLIST idbag optimistic-lock (true|false) "true">	<!-- only supported for properties of a class (not component) -->
+	<!ATTLIST idbag node CDATA #IMPLIED>
+	<!ATTLIST idbag embed-xml (true|false) "true">
+
+<!ELEMENT list (
+	meta*,
+	subselect?,
+	cache?,
+	synchronize*,
+	key, 
+	(index|list-index), 
+	(element|one-to-many|many-to-many|composite-element|many-to-any),
+	loader?,sql-insert?,sql-update?,sql-delete?,sql-delete-all?,
+	filter*
+)>
+	<!ATTLIST list name CDATA #REQUIRED>
+	<!ATTLIST list access CDATA #IMPLIED>
+	<!ATTLIST list table CDATA #IMPLIED>														 	<!-- default: name -->
+	<!ATTLIST list schema CDATA #IMPLIED>															<!-- default: none -->
+	<!ATTLIST list catalog CDATA #IMPLIED>															<!-- default: none -->
+	<!ATTLIST list subselect CDATA #IMPLIED>
+	<!ATTLIST list lazy (true|false) #IMPLIED>
+	<!ATTLIST list inverse (true|false) "false">
+	<!ATTLIST list cascade CDATA #IMPLIED>
+	<!ATTLIST list where CDATA #IMPLIED>														 	<!-- default: none -->
+	<!ATTLIST list batch-size CDATA #IMPLIED>
+	<!ATTLIST list outer-join (true|false|auto) #IMPLIED>
+	<!ATTLIST list fetch (join|select) #IMPLIED>
+	<!ATTLIST list persister CDATA #IMPLIED>																
+	<!ATTLIST list collection-type CDATA #IMPLIED>
+	<!ATTLIST list check CDATA #IMPLIED>															<!-- default: none -->
+	<!ATTLIST list optimistic-lock (true|false) "true">		<!-- only supported for properties of a class (not component) -->
+	<!ATTLIST list node CDATA #IMPLIED>
+	<!ATTLIST list embed-xml (true|false) "true">
+
+<!ELEMENT array (
+	meta*,
+	subselect?,
+	cache?,
+	synchronize*,
+	key, 
+	(index|list-index), 
+	(element|one-to-many|many-to-many|composite-element|many-to-any),
+	loader?,sql-insert?,sql-update?,sql-delete?,sql-delete-all?
+)>
+	<!ATTLIST array name CDATA #REQUIRED>
+	<!ATTLIST array access CDATA #IMPLIED>
+	<!ATTLIST array table CDATA #IMPLIED>															<!-- default: name -->
+	<!ATTLIST array schema CDATA #IMPLIED>													 		<!-- default: none -->
+	<!ATTLIST array catalog CDATA #IMPLIED>															<!-- default: none -->
+	<!ATTLIST array subselect CDATA #IMPLIED>
+	<!ATTLIST array inverse (true|false) "false">
+	<!ATTLIST array element-class CDATA #IMPLIED>
+	<!ATTLIST array cascade CDATA #IMPLIED>
+	<!ATTLIST array where CDATA #IMPLIED>															<!-- default: none -->
+	<!ATTLIST array batch-size CDATA #IMPLIED>
+	<!ATTLIST array outer-join (true|false|auto) #IMPLIED>
+	<!ATTLIST array fetch (join|select) #IMPLIED>
+	<!ATTLIST array persister CDATA #IMPLIED>															
+	<!ATTLIST array collection-type CDATA #IMPLIED>
+	<!ATTLIST array check CDATA #IMPLIED>															<!-- default: none -->
+	<!ATTLIST array optimistic-lock (true|false) "true">	<!-- only supported for properties of a class (not component) -->
+	<!ATTLIST array node CDATA #IMPLIED>
+	<!ATTLIST array embed-xml (true|false) "true">
+
+<!ELEMENT primitive-array (
+	meta*, 
+	subselect?,
+	cache?, 
+	synchronize*,
+	key, 
+	(index|list-index), 
+	element,
+	loader?,sql-insert?,sql-update?,sql-delete?,sql-delete-all?
+)>
+	<!ATTLIST primitive-array name CDATA #REQUIRED>
+	<!ATTLIST primitive-array access CDATA #IMPLIED>
+	<!ATTLIST primitive-array table CDATA #IMPLIED>									<!-- default: name -->
+	<!ATTLIST primitive-array schema CDATA #IMPLIED>								<!-- default: none -->
+	<!ATTLIST primitive-array catalog CDATA #IMPLIED>								<!-- default: none -->
+	<!ATTLIST primitive-array subselect CDATA #IMPLIED>
+	<!ATTLIST primitive-array where CDATA #IMPLIED>									<!-- default: none -->
+	<!ATTLIST primitive-array batch-size CDATA #IMPLIED>
+	<!ATTLIST primitive-array outer-join (true|false|auto) #IMPLIED>
+	<!ATTLIST primitive-array fetch (join|select) #IMPLIED>
+	<!ATTLIST primitive-array persister CDATA #IMPLIED>																
+	<!ATTLIST primitive-array collection-type CDATA #IMPLIED>
+	<!ATTLIST primitive-array check CDATA #IMPLIED>									<!-- default: none -->
+	<!ATTLIST primitive-array optimistic-lock (true|false) "true">		<!-- only supported for properties of a class (not component) -->
+	<!ATTLIST primitive-array node CDATA #IMPLIED>
+	<!ATTLIST primitive-array embed-xml (true|false) "true">
+
+<!-- Declares the element type of a collection of basic type -->
+
+<!ELEMENT element (column|formula)*>
+	<!ATTLIST element column CDATA #IMPLIED>
+	<!ATTLIST element node CDATA #IMPLIED>
+	<!ATTLIST element formula CDATA #IMPLIED>
+	<!ATTLIST element type CDATA #REQUIRED>
+	<!ATTLIST element length CDATA #IMPLIED>
+	<!ATTLIST element precision CDATA #IMPLIED>
+	<!ATTLIST element scale CDATA #IMPLIED>
+	<!ATTLIST element not-null (true|false) "false">
+	<!ATTLIST element unique (true|false) "false">
+
+<!-- One to many association. This tag declares the entity-class
+element type of a collection and specifies a one-to-many relational model -->
+
+<!ELEMENT one-to-many EMPTY>
+	<!ATTLIST one-to-many class CDATA #IMPLIED>
+	<!ATTLIST one-to-many node CDATA #IMPLIED>
+	<!ATTLIST one-to-many embed-xml (true|false) "true">
+	<!ATTLIST one-to-many entity-name CDATA #IMPLIED>
+	<!-- No column declaration attributes required in this case. The primary
+	key column of the associated class is already mapped elsewhere.-->
+
+<!-- Many to many association. This tag declares the entity-class
+element type of a collection and specifies a many-to-many relational model -->
+
+<!ELEMENT many-to-many (meta*,(column|formula)*)>
+	<!ATTLIST many-to-many class CDATA #IMPLIED>
+	<!ATTLIST many-to-many node CDATA #IMPLIED>
+	<!ATTLIST many-to-many embed-xml (true|false) "true">
+	<!ATTLIST many-to-many entity-name CDATA #IMPLIED>
+	<!ATTLIST many-to-many column CDATA #IMPLIED>
+	<!ATTLIST many-to-many formula CDATA #IMPLIED>
+	<!ATTLIST many-to-many outer-join (true|false|auto) #IMPLIED>
+	<!ATTLIST many-to-many fetch (join|select) "join">
+	<!ATTLIST many-to-many foreign-key CDATA #IMPLIED>
+	<!ATTLIST many-to-many unique (true|false) "false">
+
+<!-- A composite element allows a collection to hold instances of an arbitrary 
+class, without the requirement of joining to an entity table. Composite elements
+have component semantics - no shared references and ad hoc null value semantics. 
+Composite elements may not hold nested collections. -->
+
+<!ELEMENT composite-element ( 
+	(meta*),
+	parent?,
+	(property|many-to-one|any|nested-composite-element)* 
+)>
+	<!ATTLIST composite-element class CDATA #REQUIRED>
+	<!ATTLIST composite-element node CDATA #IMPLIED>
+
+<!ELEMENT nested-composite-element ( 
+	parent?,
+	(property|many-to-one|any|nested-composite-element)* 
+)>
+	<!ATTLIST nested-composite-element class CDATA #REQUIRED>
+	<!ATTLIST nested-composite-element name CDATA #REQUIRED>
+	<!ATTLIST nested-composite-element access CDATA #IMPLIED>
+	<!ATTLIST nested-composite-element node CDATA #IMPLIED>
+	
+<!-- Declares the column name of a foreign key. -->
+
+<!ELEMENT key (column*)>
+	<!ATTLIST key column CDATA #IMPLIED>
+	<!ATTLIST key property-ref CDATA #IMPLIED>
+	<!ATTLIST key foreign-key CDATA #IMPLIED>
+	<!ATTLIST key on-delete (cascade|noaction) "noaction">
+	<!ATTLIST key not-null (true|false) #IMPLIED>
+	<!ATTLIST key update (true|false) #IMPLIED>
+	<!ATTLIST key unique (true|false) #IMPLIED>
+	
+<!-- Declares the type and column mapping for a collection index (array or
+list index, or key of a map). -->
+
+<!ELEMENT list-index (column?)>
+	<!ATTLIST list-index column CDATA #IMPLIED>
+	<!ATTLIST list-index base CDATA "0">
+	<!ATTLIST list-index node CDATA #IMPLIED>
+
+<!ELEMENT map-key ((column|formula)*)>
+	<!ATTLIST map-key column CDATA #IMPLIED>
+	<!ATTLIST map-key formula CDATA #IMPLIED>
+	<!ATTLIST map-key type CDATA #REQUIRED>
+	<!ATTLIST map-key length CDATA #IMPLIED>
+	<!ATTLIST map-key node CDATA #IMPLIED>
+
+<!ELEMENT index (column*)>
+	<!ATTLIST index column CDATA #IMPLIED>
+	<!ATTLIST index type CDATA #IMPLIED>			<!-- required for maps -->
+	<!ATTLIST index length CDATA #IMPLIED>
+	<!ATTLIST index node CDATA #IMPLIED>
+
+<!-- Many to many association mapped to the key of a map. ie. a map keyed
+on entities. -->
+
+<!ELEMENT map-key-many-to-many ((column|formula)*)>
+	<!ATTLIST map-key-many-to-many class CDATA #IMPLIED>
+	<!ATTLIST map-key-many-to-many entity-name CDATA #IMPLIED>
+	<!ATTLIST map-key-many-to-many column CDATA #IMPLIED>
+	<!ATTLIST map-key-many-to-many formula CDATA #IMPLIED>
+	<!ATTLIST map-key-many-to-many foreign-key CDATA #IMPLIED>
+
+<!ELEMENT index-many-to-many (column*)>
+	<!ATTLIST index-many-to-many class CDATA #REQUIRED>
+	<!ATTLIST index-many-to-many entity-name CDATA #IMPLIED>
+	<!ATTLIST index-many-to-many column CDATA #IMPLIED>
+	<!ATTLIST index-many-to-many foreign-key CDATA #IMPLIED>
+
+<!-- Composite index of a map ie. a map keyed on components. -->
+
+<!ELEMENT composite-map-key ( (key-property|key-many-to-one)+ )>
+	<!ATTLIST composite-map-key class CDATA #REQUIRED>
+
+<!ELEMENT composite-index ( (key-property|key-many-to-one)+ )>
+	<!ATTLIST composite-index class CDATA #REQUIRED>
+
+<!-- A "many to any" defines a polymorphic association to any table 
+with the given identifier type. The first listed column is a VARCHAR column 
+holding the name of the class (for that row). -->
+
+<!ELEMENT many-to-any (meta-value*,column, column+)>
+	<!ATTLIST many-to-any id-type CDATA #REQUIRED>
+	<!ATTLIST many-to-any meta-type CDATA #IMPLIED>			<!--- default: Hibernate.CLASS -->
+
+<!ELEMENT index-many-to-any (column, column+)>
+	<!ATTLIST index-many-to-any id-type CDATA #REQUIRED>
+	<!ATTLIST index-many-to-any meta-type CDATA #IMPLIED>	<!--- default: Hibernate.CLASS -->
+
+<!ELEMENT collection-id (meta*, column*, generator)>
+	<!ATTLIST collection-id column CDATA #REQUIRED>
+	<!ATTLIST collection-id type CDATA #REQUIRED>
+	<!ATTLIST collection-id length CDATA #IMPLIED>
+	
+<!-- Generators generate unique identifiers. The class attribute specifies a Java 
+class implementing an id generation algorithm. -->
+
+<!ELEMENT generator (param*)>
+	<!ATTLIST generator class CDATA #REQUIRED>
+<!ELEMENT param (#PCDATA)>
+	<!ATTLIST param name CDATA #REQUIRED>
+
+<!-- The column element is an alternative to column attributes and required for 
+mapping associations to classes with composite ids. -->
+
+<!ELEMENT column EMPTY>
+	<!ATTLIST column name CDATA #REQUIRED>
+	<!ATTLIST column length CDATA #IMPLIED>						<!-- default: 255 -->
+	<!ATTLIST column precision CDATA #IMPLIED>
+	<!ATTLIST column scale CDATA #IMPLIED>
+	<!ATTLIST column not-null (true|false) #IMPLIED>		 	<!-- default: false (except for id properties) -->
+	<!ATTLIST column unique (true|false) #IMPLIED>			 	<!-- default: false (except for id properties) -->
+	<!ATTLIST column unique-key CDATA #IMPLIED>					<!-- default: no unique key -->
+	<!ATTLIST column sql-type CDATA #IMPLIED>					<!-- override default column type for hibernate type -->
+	<!ATTLIST column index CDATA #IMPLIED>
+	<!ATTLIST column check CDATA #IMPLIED>						<!-- default: none -->
+
+<!-- The formula and subselect elements allow us to map derived properties and 
+entities. -->
+
+<!ELEMENT formula (#PCDATA)>
+<!ELEMENT subselect (#PCDATA)>
+
+<!-- The cache element enables caching of an entity class. -->
+<!ELEMENT cache EMPTY>
+	<!ATTLIST cache usage (read-only|read-write|nonstrict-read-write|transactional) #REQUIRED>				
+	<!ATTLIST cache region CDATA #IMPLIED>						<!-- default: class or collection role name -->
+
+<!-- A mapped query-list allows a named query to be attached to
+a property of the domain model -->
+
+<!ELEMENT query-list EMPTY>
+	<!ATTLIST query-list name CDATA #REQUIRED>
+	<!ATTLIST query-list query-ref CDATA #REQUIRED>
+
+<!ELEMENT loader EMPTY>
+	<!ATTLIST loader query-ref CDATA #REQUIRED>
+
+<!-- The query element declares a named Hibernate query string -->
+
+<!ELEMENT query (#PCDATA|representation)*>
+	<!ATTLIST query name CDATA #REQUIRED>
+	<!ATTLIST query flush-mode (auto|never|always) #IMPLIED>
+	<!ATTLIST query cacheable (true|false) "false">
+	<!ATTLIST query cache-region CDATA #IMPLIED>
+	<!ATTLIST query fetch-size CDATA #IMPLIED>
+	<!ATTLIST query timeout CDATA #IMPLIED>
+
+<!ELEMENT representation EMPTY>
+	<!ATTLIST representation name (pojo|dom4j|dynamic-map) #REQUIRED>
+
+<!-- The sql-query element declares a named SQL query string -->
+<!ELEMENT sql-query (#PCDATA|return-scalar|return|return-join|load-collection|synchronize)*>
+	<!ATTLIST sql-query name CDATA #REQUIRED>
+	<!ATTLIST sql-query flush-mode (auto|never|always) #IMPLIED>
+	<!ATTLIST sql-query cacheable (true|false) "false">
+	<!ATTLIST sql-query cache-region CDATA #IMPLIED>
+	<!ATTLIST sql-query fetch-size CDATA #IMPLIED>
+	<!ATTLIST sql-query timeout CDATA #IMPLIED>
+
+<!--
+	Defines a return component for a sql-query.  Alias refers to the alias
+	used in the actual sql query; lock-mode specifies the locking to be applied
+	when the query is executed.  The class, collection, and role attributes are mutually exclusive;
+	class refers to the class name of a "root entity" in the object result; collection refers
+	to a collection of a given class and is used to define custom sql to load that owned collection
+	and takes the form "ClassName.propertyName"; role refers to the property path for an eager fetch
+	and takes the form "owningAlias.propertyName"
+-->
+<!ELEMENT return EMPTY>
+	<!ATTLIST return alias CDATA #REQUIRED>
+	<!ATTLIST return class CDATA #REQUIRED>
+	<!ATTLIST return lock-mode (none|read|upgrade|upgrade-nowait|write) "read">	
+
+<!ELEMENT return-join EMPTY>
+	<!ATTLIST return-join alias CDATA #REQUIRED>
+	<!ATTLIST return-join property CDATA #REQUIRED>
+	<!ATTLIST return-join lock-mode (none|read|upgrade|upgrade-nowait|write) "read">
+
+<!ELEMENT load-collection EMPTY>
+	<!ATTLIST load-collection alias CDATA #REQUIRED>
+	<!ATTLIST load-collection role CDATA #REQUIRED>
+	<!ATTLIST load-collection lock-mode (none|read|upgrade|upgrade-nowait|write) "read">
+
+<!ELEMENT return-scalar EMPTY>
+	<!ATTLIST return-scalar column CDATA #REQUIRED>
+	<!ATTLIST return-scalar type CDATA #REQUIRED>
+
+<!ELEMENT synchronize EMPTY>
+	<!ATTLIST synchronize table CDATA #REQUIRED>
+	
+<!-- custom sql operations -->
+<!ELEMENT sql-insert (#PCDATA)>
+	<!ATTLIST sql-insert callable (true|false) "false">	
+
+<!ELEMENT sql-update (#PCDATA)>
+	<!ATTLIST sql-update callable (true|false) "false">	
+
+<!ELEMENT sql-delete (#PCDATA)>
+	<!ATTLIST sql-delete callable (true|false) "false">	
+
+<!ELEMENT sql-delete-all (#PCDATA)>
+	<!ATTLIST sql-delete-all callable (true|false) "false">
Index: src/plugin-test/simplev3Test/project.properties
===================================================================
--- src/plugin-test/simplev3Test/project.properties	(revision 0)
+++ src/plugin-test/simplev3Test/project.properties	(revision 0)
@@ -0,0 +1,17 @@
+# -------------------------------------------------------------------
+# Copyright 2004 The Apache Software Foundation.
+# 
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# 
+#      http://www.apache.org/licenses/LICENSE-2.0
+#  
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# -------------------------------------------------------------------
+maven.hibernate.quiet=false
+
Index: src/plugin-test/simplev3Test/maven.xml
===================================================================
--- src/plugin-test/simplev3Test/maven.xml	(revision 0)
+++ src/plugin-test/simplev3Test/maven.xml	(revision 0)
@@ -0,0 +1,96 @@
+<!-- 
+/*
+ * Copyright 2001-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+<project xmlns:util="jelly:util"
+         xmlns:j="jelly:core"
+         xmlns:ant="jelly:ant"
+         xmlns:assert="assert"
+         xmlns:maven="jelly:maven"
+         xmlns:x="jelly:xml"
+         default="testPlugin">
+         
+  <goal name="testPlugin" prereqs="testSchemaExport,testSchemaUpdate,testAggregate">
+    <attainGoal name="clean"/>
+  </goal>
+ 
+  <goal name="testSchemaExport" prereqs="test-hibernate-schema-export-properties,test-hibernate-schema-export-configuration"/>  
+  <goal name="testSchemaUpdate" prereqs="test-hibernate-schema-update-properties,test-hibernate-schema-update-configuration"/>
+  <goal name="testAggregate"    prereqs="test-hibernate-aggregate-mappings"/>
+  
+  <goal name="test-hibernate-schema-export-properties">
+    <j:remove var="maven.hibernate.config"/>
+    <j:set var="maven.hibernate.properties" value="${basedir}/src/main/hibernate.properties" />
+    <attainGoal name="clean"/>
+    <attainGoal name="jar"/>
+    <attainGoal name="hibernate:schema-export"/>
+    
+    <assert:assertFileExists file="${maven.hibernate.output.file}"/>
+   
+  </goal>
+  
+  <goal name="test-hibernate-schema-export-configuration">
+    <j:remove var="maven.hibernate.properties"/>
+    <j:set var="maven.hibernate.config" value="${basedir}/target/classes/hibernate.cfg.xml" />    
+    <attainGoal name="clean"/>
+    <attainGoal name="jar"/>
+    <attainGoal name="hibernate:schema-export"/>
+    
+    <assert:assertFileExists file="${maven.hibernate.output.file}"/>
+   
+  </goal>  
+  
+  <goal name="test-hibernate-schema-update-properties">
+    <j:remove var="maven.hibernate.config"/>
+    <j:set var="maven.hibernate.properties" value="${basedir}/src/main/hibernate.properties" />    
+    <attainGoal name="clean"/>
+    <attainGoal name="jar"/>
+    <attainGoal name="hibernate:schema-update"/>       
+    
+    <!-- unfortunately goal does not generate a file output, so we cannot assert anything -->
+    
+  </goal>
+  
+  <goal name="test-hibernate-schema-update-configuration">
+    <j:remove var="maven.hibernate.properties"/>
+    <j:set var="maven.hibernate.config" value="${basedir}/target/classes/hibernate.cfg.xml" />    
+    <attainGoal name="clean"/>
+    <attainGoal name="jar"/>
+    <attainGoal name="hibernate:schema-update"/>
+    
+    <!-- unfortunately goal does not generate a file output, so we cannot assert anything -->
+    
+  </goal>  
+  
+  
+  <goal name="test-hibernate-aggregate-mappings">
+    <j:if test="${maven.mode.online}">
+	    <j:set var="maven.hibernate.input.dir" value="${maven.build.dest},${basedir}/src/etc" />    
+	    <attainGoal name="jar"/>
+	    <attainGoal name="hibernate:aggregate-mappings"/>
+	    
+	    <assert:assertFileExists file="${maven.hibernate.aggregate.output.file}"/>
+	    
+	    <!-- Verify that that files from both base directories are present -->
+	    <util:file var="rawFile" name="${maven.hibernate.aggregate.output.file}"/>
+	    <x:parse var="doc" xml="${rawFile}"/>
+	
+	    <x:set var="count" select="count($doc//hibernate-mapping//class)"/>
+	    <assert:assertEquals expected="2" value="${count.intValue().toString()}"/>  
+	</j:if>
+  </goal>  
+  
+</project>
Index: src/plugin-test/simplev3Test/project.xml
===================================================================
--- src/plugin-test/simplev3Test/project.xml	(revision 0)
+++ src/plugin-test/simplev3Test/project.xml	(revision 0)
@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- 
+/*
+ * Copyright 2001-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+
+<project>
+  <pomVersion>3</pomVersion>
+  <id>test-maven-hibernate-plugin-simplev3Test</id>
+  <name>Simple Test Cases for Maven Hibernate v3 compatibility</name>
+  <groupId>maven</groupId>
+  <currentVersion>1.0-SNAPSHOT</currentVersion>
+  <organization>
+    <name>Apache Software Foundation</name>
+    <url>http://www.apache.org/</url>
+    <logo>http://maven.apache.org/images/jakarta-logo-blue.gif</logo>
+  </organization>
+  <inceptionYear>2001</inceptionYear>
+  <package>org.apache.maven</package>
+  <logo>http://maven.apache.org/images/maven.jpg</logo>
+  <description>Test for Maven Hibernate plugin</description>
+  <shortDescription>Test for Maven Hibernate plugin</shortDescription>
+  <url>http://maven.apache.org/reference/plugins/hibernate/</url>
+  <siteDirectory>/www/maven.apache.org/reference/plugins/hibernate/</siteDirectory>
+  <repository>
+    <connection>scm:svn:http://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk/hibernate/src/plugin-test</connection>
+    <url>http://svn.apache.org/viewcvs.cgi/maven/maven-1/plugins/trunk/hibernate/src/plugin-test</url>
+  </repository>
+  <developers>
+    <developer>
+      <name>Eric Pugh</name>
+      <id>epugh</id>
+      <email>epugh@opensourceconnections.com</email>
+      <organization>OpenSource Connections</organization>
+      <roles>
+        <role>Developer</role>
+      </roles>
+    </developer>
+    <developer>
+      <name>Felipe Leme</name>
+      <id>felipeal</id>
+      <email>maven@felipeal.net</email>
+      <organization>Falcon Informatica</organization>
+      <roles>
+        <role>Java Developer</role>
+      </roles>
+      <timezone>-3</timezone>
+    </developer>     
+  </developers>
+
+  <dependencies>
+  
+    <dependency>
+      <groupId>commons-jelly</groupId>
+      <artifactId>commons-jelly-tags-xml</artifactId>
+      <version>20030211.142705</version>
+      <url>http://jakarta.apache.org/commons/jelly/libs/xml/</url>
+    </dependency>
+  
+      
+    <dependency>
+      <groupId>hsqldb</groupId>
+      <artifactId>hsqldb</artifactId>
+      <version>1.7.3.3</version>
+      <type>jar</type>
+    </dependency>
+  
+    <dependency>
+      <groupId>hibernate</groupId>
+      <artifactId>hibernate</artifactId>
+      <version>3.0.1</version>
+      <type>jar</type>
+    </dependency>
+
+    <!-- JTA Must Be Local, It's Not Available On ibiblio.org -->
+    <dependency>
+      <id>jta</id>
+      <version>1.0.1b</version>
+    </dependency>
+
+    <dependency>
+      <groupId>cglib</groupId>
+      <artifactId>cglib</artifactId>
+      <version>2.0.2</version>
+      <type>jar</type>
+    </dependency>
+    <dependency>
+      <groupId>dom4j</groupId>
+      <artifactId>dom4j</artifactId>
+      <version>1.4</version>
+      <type>jar</type>
+    </dependency>  
+  </dependencies>
+  
+  <build>
+    <sourceDirectory>src/main</sourceDirectory>
+    <resources>
+      <resource>
+        <directory>src/main</directory>
+        <includes>
+          <include>**/*.xml</include>
+        </includes>
+      </resource>
+    </resources> 
+  </build>
+</project>
Index: src/plugin-test/simplev3Test/src/main/org/apache/maven/hibernate/Item.hbm.xml
===================================================================
--- src/plugin-test/simplev3Test/src/main/org/apache/maven/hibernate/Item.hbm.xml	(revision 0)
+++ src/plugin-test/simplev3Test/src/main/org/apache/maven/hibernate/Item.hbm.xml	(revision 0)
@@ -0,0 +1,33 @@
+<?xml version="1.0"?>
+<!-- 
+/*
+ * Copyright 2001-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+  <!DOCTYPE hibernate-mapping PUBLIC
+   "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+   "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+  <hibernate-mapping auto-import="false">
+  
+    <class name="org.apache.maven.hibernate.Item" table="Item" >
+      <id name="id" type="int" column="ID" unsaved-value="0">
+        <generator class="native"/>
+      </id>
+      <property name="name" column="NAME" type="string"/>
+    </class>
+
+
+  </hibernate-mapping>
\ No newline at end of file
Index: src/plugin-test/simplev3Test/src/main/org/apache/maven/hibernate/Component.java
===================================================================
--- src/plugin-test/simplev3Test/src/main/org/apache/maven/hibernate/Component.java	(revision 0)
+++ src/plugin-test/simplev3Test/src/main/org/apache/maven/hibernate/Component.java	(revision 0)
@@ -0,0 +1,56 @@
+package org.apache.maven.hibernate;
+
+/* ====================================================================
+ *   Copyright 2001-2004 The Apache Software Foundation.
+ *
+ *   Licensed under the Apache License, Version 2.0 (the "License");
+ *   you may not use this file except in compliance with the License.
+ *   You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *   See the License for the specific language governing permissions and
+ *   limitations under the License.
+ * ====================================================================
+ */
+
+/**
+ * Class to use with testing the plugin.
+ * 
+ * @author <a href="mailto:epugh@opensourceconnections.com">Eric Pugh</a>
+ *
+ * @version $Id$
+ */
+
+public class Component {
+    private int id;
+    private String name;
+
+    /**
+     * @return Returns the id.
+     */
+    public int getId() {
+        return id;
+    }
+    /**
+     * @param id The id to set.
+     */
+    public void setId(int id) {
+        this.id = id;
+    }
+    /**
+     * @return Returns the name.
+     */
+    public String getName() {
+        return name;
+    }
+    /**
+     * @param name The name to set.
+     */
+    public void setName(String name) {
+        this.name = name;
+    }
+}
Index: src/plugin-test/simplev3Test/src/main/org/apache/maven/hibernate/Item.java
===================================================================
--- src/plugin-test/simplev3Test/src/main/org/apache/maven/hibernate/Item.java	(revision 0)
+++ src/plugin-test/simplev3Test/src/main/org/apache/maven/hibernate/Item.java	(revision 0)
@@ -0,0 +1,56 @@
+package org.apache.maven.hibernate;
+
+/* ====================================================================
+ *   Copyright 2001-2004 The Apache Software Foundation.
+ *
+ *   Licensed under the Apache License, Version 2.0 (the "License");
+ *   you may not use this file except in compliance with the License.
+ *   You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *   See the License for the specific language governing permissions and
+ *   limitations under the License.
+ * ====================================================================
+ */
+
+/**
+ * Class to use with testing the plugin.
+ * 
+ * @author <a href="mailto:epugh@opensourceconnections.com">Eric Pugh</a>
+ *
+ * @version $Id$
+ */
+
+public class Item {
+    private int id;
+    private String name;
+
+    /**
+     * @return Returns the id.
+     */
+    public int getId() {
+        return id;
+    }
+    /**
+     * @param id The id to set.
+     */
+    public void setId(int id) {
+        this.id = id;
+    }
+    /**
+     * @return Returns the name.
+     */
+    public String getName() {
+        return name;
+    }
+    /**
+     * @param name The name to set.
+     */
+    public void setName(String name) {
+        this.name = name;
+    }
+}
Index: src/plugin-test/simplev3Test/src/main/hibernate.properties
===================================================================
--- src/plugin-test/simplev3Test/src/main/hibernate.properties	(revision 0)
+++ src/plugin-test/simplev3Test/src/main/hibernate.properties	(revision 0)
@@ -0,0 +1,5 @@
+hibernate.dialect org.hibernate.dialect.HSQLDialect
+hibernate.connection.driver_class org.hsqldb.jdbcDriver
+hibernate.connection.username sa
+hibernate.connection.password
+hibernate.connection.url jdbc:hsqldb:.
\ No newline at end of file
Index: src/plugin-test/simplev3Test/src/main/hibernate.cfg.xml
===================================================================
--- src/plugin-test/simplev3Test/src/main/hibernate.cfg.xml	(revision 0)
+++ src/plugin-test/simplev3Test/src/main/hibernate.cfg.xml	(revision 0)
@@ -0,0 +1,26 @@
+<?xml version='1.0' encoding='utf-8'?>
+<!DOCTYPE hibernate-configuration PUBLIC
+        "-//Hibernate/Hibernate Configuration DTD//EN"
+
+ "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
+
+
+<hibernate-configuration>
+    <!-- shared properties -->
+
+    <session-factory>
+
+    <property name="connection.driver_class">org.hsqldb.jdbcDriver</property>
+    <property name="connection.url">jdbc:hsqldb:.</property>
+    <property name="connection.username">sa</property>
+    <property name="connection.password"></property>
+    <property name="connection.pool_size">0</property>
+    <property name="show_sql">false</property>
+    <property name="dialect">org.hibernate.dialect.HSQLDialect</property>
+    
+    <!--<mapping resource="org/apache/maven/hibernate/Item.hbm.xml"/>-->  
+    
+    </session-factory>
+
+</hibernate-configuration>
+
Index: src/plugin-test/simplev3Test/src/etc/Component.hbm.xml
===================================================================
--- src/plugin-test/simplev3Test/src/etc/Component.hbm.xml	(revision 0)
+++ src/plugin-test/simplev3Test/src/etc/Component.hbm.xml	(revision 0)
@@ -0,0 +1,16 @@
+<?xml version="1.0"?>
+  <!DOCTYPE hibernate-mapping PUBLIC
+   "-//Hibernate/Hibernate Mapping DTD 2.0//EN" 
+   "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd"> 
+
+  <hibernate-mapping auto-import="false">
+  
+    <class name="org.apache.maven.hibernate.Component" table="Component" >
+      <id name="id" type="int" column="ID" unsaved-value="0">
+           <generator class="native"/>
+        </id>
+      <property name="name" column="NAME" type="string"/>      
+      
+    </class>   
+    
+  </hibernate-mapping>
\ No newline at end of file
Index: src/plugin-test/maven.xml
===================================================================
--- src/plugin-test/maven.xml	(revision 165338)
+++ src/plugin-test/maven.xml	(working copy)
@@ -20,7 +20,13 @@
   default="testPlugin">
 
   <goal name="testPlugin">
-    <maven:reactor basedir="${basedir}" includes="*Test/project.xml" goals="testPlugin" banner="Test" ignoreFailures="false"/>
+     <maven:reactor
+         basedir="${basedir}"
+         includes="*Test/project.xml"
+         excludes="codeGenerationTest/project.xml"
+         goals="testPlugin"
+         banner="Test"
+         ignoreFailures="false"/>
   </goal>
 
 </project>
Index: src/plugin-test/simpleTest/project.xml
===================================================================
--- src/plugin-test/simpleTest/project.xml	(revision 165338)
+++ src/plugin-test/simpleTest/project.xml	(working copy)
@@ -75,17 +75,22 @@
     <dependency>
       <groupId>hsqldb</groupId>
       <artifactId>hsqldb</artifactId>
-      <version>1.7.1</version>
+      <version>1.7.3.3</version>
       <type>jar</type>
     </dependency>
-  
     <dependency>
       <groupId>hibernate</groupId>
       <artifactId>hibernate</artifactId>
       <version>2.1.3</version>
       <type>jar</type>
-    </dependency>    
+    </dependency>
     <dependency>
+      <groupId>hibernate</groupId>
+      <artifactId>hibernate-tools</artifactId>
+      <version>2.1.3</version>
+      <type>jar</type>
+    </dependency>
+    <dependency>
       <groupId>cglib</groupId>
       <artifactId>cglib</artifactId>
       <version>2.0.2</version>
