Index: codegen/BasicRenderer.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/tools/codegen/BasicRenderer.java,v
retrieving revision 1.14
diff -u -r1.14 BasicRenderer.java
--- codegen/BasicRenderer.java	29 Dec 2002 01:30:55 -0000	1.14
+++ codegen/BasicRenderer.java	29 Dec 2002 23:33:37 -0000
@@ -3,7 +3,9 @@
 
 import java.io.PrintWriter;
 import java.util.Iterator;
+import java.util.List;
 import java.util.Map;
+import java.util.TreeSet;
 
 public class BasicRenderer implements Renderer {
 
@@ -73,68 +75,95 @@
         // fields
         for (Iterator fields = classMapping.getFields().iterator(); fields.hasNext();) {
             Field field = (Field) fields.next();
-            writer.println("    private " + field.getType() + ' ' + field.getName() + 
+            writer.println("    private " + shortenType(field.getType(),classMapping.getImports()) + ' ' + field.getName() + 
             	( field.isIdentifier() ? "; //identifier" : "; //persistent") 
             );
         }
         writer.println();
         
         // full constructor
-        int fullConsArgCount = 0;
+        List allFieldsForFullConstructor = classMapping.getAllFieldsForFullConstructor();
+        
+        writer.println("// Full constructor");
         String fullCons = "    public " + classMapping.getName() + "(";
-        for(Iterator fields = classMapping.getFields().iterator(); fields.hasNext();) {
+        
+        
+        for(Iterator fields = allFieldsForFullConstructor.iterator(); fields.hasNext();) {
             Field field = (Field) fields.next();
-            if(!field.isIdentifier() || (field.isIdentifier() && !field.isGenerated())) {
-                fullCons = fullCons + field.getType() + " " + field.getName();
-                fullCons = fullCons + ", ";
-                fullConsArgCount++;  
-            }
+                fullCons = fullCons + shortenType(getTrueTypeName(field, class2classmap), classMapping.getImports()) + " " + field.getName();
+                if(fields.hasNext()) {
+                  fullCons = fullCons + ", ";
+                }
         }
-        if ( fullCons.endsWith(", ") ) fullCons = fullCons.substring(0, fullCons.length()-2);
-
+        
         writer.println(fullCons + ") {");
-        for(Iterator fields = classMapping.getFields().iterator(); fields.hasNext();) {
-            Field field = (Field) fields.next();
-            if(!field.isIdentifier() || (field.isIdentifier() && !field.isGenerated())) {
-                writer.println("        this." + field.getName() + " = " + field.getName() + ";");
+        //invoke super to initialize superclass...
+        List supersConstructorFields = classMapping.getFieldsForSupersFullConstructor();
+        if (!supersConstructorFields.isEmpty()) {
+            writer.print("      super(");
+            for (Iterator fields = supersConstructorFields.iterator(); fields.hasNext();) {
+                Field field = (Field) fields.next();
+                writer.print(field.getName());
+                if(fields.hasNext()) {
+                    writer.print(", ");
+                }
             }
+            writer.println(");");
+        }
+        
+        // initialisation of localfields
+        for(Iterator fields = classMapping.getLocalFieldsForFullConstructor().iterator(); fields.hasNext();) {
+            Field field = (Field) fields.next();
+            writer.println("        this." + field.getName() + " = " + field.getName() + ";");
         }
         writer.println("    }");
         writer.println();
 
         // no args constructor (if fullconstructor had any arguments!)
-        if (fullConsArgCount > 0) {
+        if (allFieldsForFullConstructor.size() > 0) {
+            writer.println("// No arg constructor");
 			writer.println("    public " + classMapping.getName() + "() {");
 			writer.println("    }");
 			writer.println();
 		}
         
-        // minimal constructor (only if the fullconstructor had any arguments) 
-        if(fullConsArgCount>0) {
+        // minimal constructor (only if the fullconstructor had any arguments)
+        if ((allFieldsForFullConstructor.size() > 0) && classMapping.needsMinimalConstructor()) {
+
+            List allFieldsForMinimalConstructor = classMapping.getAllFieldsForMinimalConstructor();
+            writer.println("// Minimal constructor"); 
         
-	        if( classMapping.needsMinimalConstructor() ) {
-	            String minCons = "    public " + classMapping.getName() + "(";
-	            for(Iterator fields = classMapping.getFields().iterator(); fields.hasNext();) {
-	                Field field = (Field) fields.next();
-	                if((!field.isIdentifier() && !field.isNullable()) ||
-	                    (field.isIdentifier() && !field.isGenerated())) {
-	                    minCons = minCons + field.getType() + " " + field.getName();
-	                    minCons = minCons + ", ";
-	                }
-	            }
-	            if ( minCons.endsWith(", ") ) minCons = minCons.substring(0, minCons.length()-2);
-	
-	            writer.println(minCons + ") {");
-	            for(Iterator fields = classMapping.getFields().iterator(); fields.hasNext();) {
-	                Field field = (Field) fields.next();
-	                if((!field.isIdentifier() && !field.isNullable()) ||
-	                    (field.isIdentifier() && !field.isGenerated())) {
-	                    writer.println("        this." + field.getName() + " = " + field.getName() + ";");
-	                }
-	            }
-	            writer.println("    }");
-	            writer.println();
-	        }
+            String minCons = "    public " + classMapping.getName() + "(";
+            for (Iterator fields = allFieldsForMinimalConstructor.iterator(); fields.hasNext();) {
+                Field field = (Field) fields.next();
+                minCons = minCons + shortenType(getTrueTypeName(field, class2classmap), classMapping.getImports()) + " " + field.getName();
+                if (fields.hasNext()) {
+                    minCons = minCons + ", ";
+                }
+            }
+
+            writer.println(minCons + ") {");
+//          invoke super to initialize superclass...
+                  List supersMinConstructorFields = classMapping.getFieldsForSupersMinimalConstructor();
+                  if (!supersMinConstructorFields.isEmpty()) {
+                      writer.print("      super(");
+                      for (Iterator fields = supersMinConstructorFields.iterator(); fields.hasNext();) {
+                          Field field = (Field) fields.next();
+                          writer.print(field.getName());
+                          if(fields.hasNext()) {
+                              writer.print(", ");
+                          }
+                      }
+                      writer.println(");");
+                  }
+        
+            // initialisation of localfields
+            for (Iterator fields = classMapping.getLocalFieldsForMinimalConstructor().iterator(); fields.hasNext();) {
+                Field field = (Field) fields.next();
+                writer.println("        this." + field.getName() + " = " + field.getName() + ";");
+            }
+            writer.println("    }");
+            writer.println();
         }
 
         // field accessors
@@ -191,6 +220,26 @@
         }
 		
         writer.println("}");
+    }
+    /**
+     * Returns the last part of type if it is in the set of imports.
+     * e.g. java.util.Date would become Date, if imports contains java.util.
+     * Date.
+     * @param type
+     * @param imports
+     * @return String
+     */
+    private String shortenType(String type, TreeSet imports) {
+        if(imports.contains(type)) {
+          return type.substring(type.lastIndexOf('.')+1);
+        } else {
+          if(type.endsWith("[]")) {
+            return shortenType(type.substring(0,type.length()-2), imports) + "[]";    
+          } else {
+          return type;   
+          }
+          
+        }
     }
 
 }
Index: codegen/ClassMapping.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/tools/codegen/ClassMapping.java,v
retrieving revision 1.21
diff -u -r1.21 ClassMapping.java
--- codegen/ClassMapping.java	29 Dec 2002 01:30:55 -0000	1.21
+++ codegen/ClassMapping.java	29 Dec 2002 23:33:37 -0000
@@ -20,6 +20,7 @@
 public class ClassMapping {
    private ClassName name = null;
    private String superClass = null;
+   private ClassMapping superClassMapping = null;
    private String proxyClass = null;
    private List fields = new ArrayList();
    private TreeSet imports = new TreeSet();
@@ -27,6 +28,27 @@
    private static final Map components = new HashMap();
    private boolean mustImplementEquals = false;
    
+   public ClassMapping(ClassName superClass, ClassMapping superClassMapping, Element classElement) throws Exception {
+         this(superClass, classElement);
+      
+         this.superClassMapping = superClassMapping;
+         
+         if(this.superClassMapping!=null) {
+             List l = this.superClassMapping.getAllFieldsForFullConstructor();
+             for (Iterator iter = l.iterator(); iter.hasNext();) {
+                Field element = (Field) iter.next();
+                ClassName ct = element.getClassType();
+                if(ct!=null) { // add imports for superclasses possible fields.
+                 addImport(ct); 
+                } else {
+                 addImport(element.getType());
+                }
+            }
+             
+             
+         }
+      }
+   
    public ClassMapping(ClassName superClass, Element classElement) throws Exception {
       this(classElement);
       
@@ -86,7 +108,7 @@
             classType.setFullyQualifiedName(cmpclass);
             // add an import and field for this property
             addImport(classType);
-            fields.add( new Field(cmpname, classType.getName(), false, true, false) );
+            fields.add( new Field(cmpname, classType, false, true, false) );
             components.put( mapping.getCanonicalName(), mapping );
          }
       }
@@ -177,8 +199,7 @@
           
          // add an import and field for this property
          addImport(classType);
-         Field f = new Field( name, classType.getName(), nullable && !key, key, false );
-         f.setClassType(classType);
+         Field f = new Field( name, classType, nullable && !key, key, false );
          fields.add(f);
       }
       
@@ -191,19 +212,7 @@
       doArrays(classElement, "primitive-array");
       
       
-      // subclasses
       
-      for ( Iterator iter = classElement.getChildren("subclass").iterator(); iter.hasNext(); ) {
-         Element subclass = (Element) iter.next();
-         ClassMapping subclassMapping = new ClassMapping(name, subclass);
-         subclasses.add(subclassMapping);
-      }
-      
-      for ( Iterator iter = classElement.getChildren("joined-subclass").iterator(); iter.hasNext(); ) {
-         Element subclass = (Element) iter.next();
-         ClassMapping subclassMapping = new ClassMapping(name, subclass);
-         subclasses.add(subclassMapping);
-      }
       
       //components
       
@@ -221,9 +230,23 @@
          classType.setFullyQualifiedName(cmpclass);
          // add an import and field for this property
          addImport(classType);
-         fields.add( new Field(cmpname, classType.getName(), false) );
+         fields.add( new Field(cmpname, classType, false) );
          components.put( mapping.getCanonicalName(), mapping );
       }
+      
+        //    subclasses (done last so they can access this superclass for info)
+      
+         for ( Iterator iter = classElement.getChildren("subclass").iterator(); iter.hasNext(); ) {
+            Element subclass = (Element) iter.next();
+            ClassMapping subclassMapping = new ClassMapping(name, this,subclass);
+            subclasses.add(subclassMapping);
+         }
+      
+         for ( Iterator iter = classElement.getChildren("joined-subclass").iterator(); iter.hasNext(); ) {
+            Element subclass = (Element) iter.next();
+            ClassMapping subclassMapping = new ClassMapping(name, this, subclass);
+            subclasses.add(subclassMapping);
+         }
    }
    
    public void implementEquals() {
@@ -293,13 +316,88 @@
       
    }
    
+   public List getLocalFieldsForFullConstructor() {
+          List result = new ArrayList();
+            for(Iterator fields = getFields().iterator(); fields.hasNext();) {
+                 Field field = (Field) fields.next();
+                 if(!field.isIdentifier() || (field.isIdentifier() && !field.isGenerated())) {
+                     result.add(field);
+                 }
+             }       
+       
+          return result;
+      }
+   
+    public List getFieldsForSupersFullConstructor() {
+          List result = new ArrayList();
+          if(getSuperClassMapping()!=null) {
+              // The correct sequence is vital here, as the subclass should be
+              // able to invoke the fullconstructor based on the sequence returned
+              // by this method!
+              result.addAll(getSuperClassMapping().getFieldsForSupersFullConstructor());
+              result.addAll(getSuperClassMapping().getLocalFieldsForFullConstructor());
+          }
+       
+          return result;
+      }
+         
+   public List getLocalFieldsForMinimalConstructor() {
+    List result = new ArrayList();
+    for (Iterator fields = getFields().iterator(); fields.hasNext();) {
+        Field field = (Field) fields.next();
+        if ((!field.isIdentifier() && !field.isNullable()) || 
+             (field.isIdentifier() && !field.isGenerated())) {
+            result.add(field);
+        }
+    }
+    return result;
+}
+   public List getAllFieldsForFullConstructor() {
+       
+       List result = getFieldsForSupersFullConstructor();
+       result.addAll(getLocalFieldsForFullConstructor());
+       return result;
+   }
+   
+     public List getFieldsForSupersMinimalConstructor() {
+          List result = new ArrayList();
+          if(getSuperClassMapping()!=null) {
+              // The correct sequence is vital here, as the subclass should be
+              // able to invoke the fullconstructor based on the sequence returned
+              // by this method!
+              result.addAll(getSuperClassMapping().getFieldsForSupersMinimalConstructor());
+              result.addAll(getSuperClassMapping().getLocalFieldsForMinimalConstructor());
+          }
+       
+          return result;
+      }
+      
+    public List getAllFieldsForMinimalConstructor() {
+       
+         List result = getFieldsForSupersMinimalConstructor();
+         result.addAll(getLocalFieldsForMinimalConstructor());
+         return result;
+       }
+       
    private void addImport(ClassName className) {
       // if the package is java.lang or our own package don't add
-      if ( !className.inJavaLang() && !className.inSamePackage(name) ) {
-         imports.add( className.getFullyQualifiedName() );
+      if ( !className.inJavaLang() && !className.inSamePackage(name) && !className.isPrimitive()) {
+          if(className.isArray()) {
+            imports.add( className.getFullyQualifiedName().substring(0,className.getFullyQualifiedName().length()-2) ); // remove []
+          } else {
+              imports.add( className.getFullyQualifiedName() );
+          }
       }
    }
    
+   private void addImport(String className) {
+       ClassName cn = new ClassName();
+       cn.setFullyQualifiedName(className);
+       addImport(cn);
+       
+   }
+  
+   
    public static Iterator getComponents() {
       return components.values().iterator();
    }
@@ -319,9 +417,12 @@
          
          // add an import and field for this collection
          addImport(interfaceClassName);
-         addImport(implementingClassName);
+          // import implementingClassName should only be 
+          // added if the initialisaiton code of the field 
+          // is actually used - and currently it isn't!
+         //addImport(implementingClassName); 
          
-         fields.add(new Field(name, interfaceClassName.getName(), "new " + implementingClassName.getName() + "()", false) );
+         fields.add(new Field(name, interfaceClassName, "new " + implementingClassName.getName() + "()", false) );
          if (collection.getChildren("composite-element") != null) {
            for (Iterator compositeElements = collection.getChildren("composite-element").iterator(); compositeElements.hasNext(); ) {
              Element compositeElement = (Element) compositeElements.next();
@@ -359,18 +460,23 @@
             elementClass = elt.getAttributeValue("type");
             if (elementClass==null) elementClass=elt.getAttributeValue("class");
          }
-         fields.add( new Field( role, getFieldType(elementClass) + "[]", false ) );
+         ClassName cn = getFieldType(elementClass);
+         cn.setFullyQualifiedName(cn.getFullyQualifiedName() + "[]",cn.isPrimitive());
+         cn.setIsArray(true);
+         fields.add( new Field( role, cn, false ) );
       }
    }
    
-   private String getFieldType(String hibernateType) {
+   private ClassName getFieldType(String hibernateType) {
       return getFieldType(hibernateType, false);
    }
    
-   private String getFieldType(String hibernateType, boolean needObject) {
+   private ClassName getFieldType(String hibernateType, boolean needObject) {
       // deal with hibernate binary type
+      ClassName cn = new ClassName();
       if ( hibernateType.equals("binary") ) {
-         return "byte[]";
+          cn.setFullyQualifiedName("byte[]",true);
+         return cn;
       }
       else {
          Type basicType = TypeFactory.basic(hibernateType);
@@ -381,10 +487,12 @@
             !hibernateType.trim().equals( basicType.returnedClass().getName() ) &&
             !needObject
             ) {
-               return ( (PrimitiveType) basicType ).primitiveClass().getName();
+               cn.setFullyQualifiedName(( (PrimitiveType) basicType ).primitiveClass().getName(),true);
+               return cn;
             }
             else {
-               return basicType.returnedClass().getName();
+                cn.setFullyQualifiedName(basicType.returnedClass().getName());
+                return cn;
             }
             
          }
@@ -393,11 +501,30 @@
             classType.setFullyQualifiedName(hibernateType);
             // add an import and field for this property
             addImport(classType);
-            return classType.getName();
+            return classType;
          }
       }
    }
    
+
    
-   
+/**
+ * Returns the superClassMapping.
+ * @return ClassMapping
+ */
+public ClassMapping getSuperClassMapping() {
+    return superClassMapping;
 }
+
+/**
+ * Sets the superClassMapping.
+ * @param superClassMapping The superClassMapping to set
+ */
+public void setSuperClassMapping(ClassMapping superClassMapping) {
+    this.superClassMapping = superClassMapping;
+}
+
+}
+
+   
+
Index: codegen/ClassName.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/tools/codegen/ClassName.java,v
retrieving revision 1.3
diff -u -r1.3 ClassName.java
--- codegen/ClassName.java	9 Oct 2002 03:52:10 -0000	1.3
+++ codegen/ClassName.java	29 Dec 2002 23:33:36 -0000
@@ -6,19 +6,34 @@
     private String fullyQualifiedName = null;
     private String packageName = null;
     private String name = null;
-
+    private boolean primitive = false;
+    private boolean isArray = false;
+    
     public void setFullyQualifiedName(String fullyQualifiedName) {
-        this.fullyQualifiedName = fullyQualifiedName;
-        int lastDot = fullyQualifiedName.lastIndexOf(".");
-		if (lastDot<0 ) {
-			name = fullyQualifiedName;
-			packageName = null;
-		}
-		else {
-        	name = fullyQualifiedName.substring(lastDot + 1);
-        	packageName = fullyQualifiedName.substring(0, lastDot);
-		}
+        setFullyQualifiedName(fullyQualifiedName,false);
     }
+    
+        public void setFullyQualifiedName(String fullyQualifiedName, boolean isPrimitive) {
+        this.fullyQualifiedName = fullyQualifiedName;
+        primitive = isPrimitive;
+        if (!isPrimitive) {
+
+            if (fullyQualifiedName != null) {
+
+                int lastDot = fullyQualifiedName.lastIndexOf(".");
+                if (lastDot < 0) {
+                    name = fullyQualifiedName;
+                    packageName = null;
+                } else {
+                    name = fullyQualifiedName.substring(lastDot + 1);
+                    packageName = fullyQualifiedName.substring(0, lastDot);
+                }
+            } else {
+                name = fullyQualifiedName;
+                packageName = null;
+            }
+        }
+        }
 
     public String getFullyQualifiedName() {
         return this.fullyQualifiedName;
@@ -45,4 +60,26 @@
     	ClassName otherClassName = (ClassName) other;
     	return otherClassName.fullyQualifiedName.equals(fullyQualifiedName);
     }
+    /**
+     * Method isPrimitive.
+     * @return boolean
+     */
+    public boolean isPrimitive() {
+        return primitive;
+    }
+    /**
+     * Method setIsArray.
+     * @param b
+     */
+    public void setIsArray(boolean b) {
+        isArray=b;
+    }
+    /**
+     * Method isArray.
+     * @return boolean
+     */
+    public boolean isArray() {
+        return isArray;
+    }
+    
 }
Index: codegen/Field.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/tools/codegen/Field.java,v
retrieving revision 1.6
diff -u -r1.6 Field.java
--- codegen/Field.java	29 Dec 2002 01:30:55 -0000	1.6
+++ codegen/Field.java	29 Dec 2002 23:33:36 -0000
@@ -4,7 +4,7 @@
 
 public class Field {
     private String name = null;
-    private String type = null;
+   // private String type = null;
     private String initialisation = null;
     private String asSuffix = null;
     private boolean id = false;
@@ -12,24 +12,24 @@
     private boolean nullable = true;
 	private ClassName classType;
     
-    public Field(String name, String type, boolean nullable) {
+    public Field(String name, ClassName type, boolean nullable) {
         this.name = name;
-        this.type = type;
+        setType(type);
         this.nullable = nullable;
         
         this.asSuffix = name.substring(0, 1).toUpperCase() + name.substring(1);
     }
     
-    public Field(String name, String type, boolean nullable, boolean id, boolean generated) {
+    public Field(String name, ClassName type, boolean nullable, boolean id, boolean generated) {
         this.name = name;
-        this.type = type;
+        setType(type);
         this.id = id;
         this.nullable = nullable; //?
         this.generated = generated;
         this.asSuffix = name.substring(0, 1).toUpperCase() + name.substring(1);
     }
     
-    public Field(String name, String type, String initialisation, boolean nullable) {
+    public Field(String name, ClassName type, String initialisation, boolean nullable) {
         this(name, type, nullable);
         
         this.initialisation = initialisation;
@@ -48,6 +48,7 @@
     }
     
     public String getType() {
+        String type = classType.getFullyQualifiedName();
         int loc = type.indexOf("java.lang.");
         if ( loc<0 ) {
             return type;
@@ -72,13 +73,7 @@
     public String toString() {
         return getType() + ":" + getName();    
     }    
-	/**
-	 * Method setClassType.
-	 * @param classType
-	 */
-	public void setClassType(ClassName classType) {
-        this.classType = classType;
-	}
+	
 	/**
 	 * Returns the classType. Can be null as it is not always possible to get 
      * all info for a field class.
@@ -87,5 +82,11 @@
 	public ClassName getClassType() {
 		return classType;
 	}
+
+    private void setType(ClassName type) {
+        this.classType = type;
+    }
+
+   
 
 }
Index: codegen/test/Test.hbm.xml
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/tools/codegen/test/Test.hbm.xml,v
retrieving revision 1.4
diff -u -r1.4 Test.hbm.xml
--- codegen/test/Test.hbm.xml	25 Dec 2002 04:44:02 -0000	1.4
+++ codegen/test/Test.hbm.xml	29 Dec 2002 23:33:37 -0000
@@ -52,6 +52,7 @@
             <property name="date"
                       type="date"/>
         </subclass>
+        
         <subclass name="codegen.test.Group">
             <list role="members"
                   table="tblGroupMembers">
@@ -61,6 +62,16 @@
                               column="principalId"/>
             </list>
         </subclass>
+        <!-- To test referring to subclass in another package -->
+        <subclass name="codegen.test.other.Group">
+		   <property name="simpleAttrib" type="string"/>
+
+		<array role="otherGroups" element-class="codegen.test.User">
+        	<key column="principal"/>
+        	<one-to-many class="codegen.test.User"/>
+        </array>
+        </subclass>
+
     </class>
 
     <class name="codegen.test.Person">
Index: codegen/test/Test2.hbm.xml
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/tools/codegen/test/Test2.hbm.xml,v
retrieving revision 1.3
diff -u -r1.3 Test2.hbm.xml
--- codegen/test/Test2.hbm.xml	29 Dec 2002 01:30:54 -0000	1.3
+++ codegen/test/Test2.hbm.xml	29 Dec 2002 23:33:37 -0000
@@ -4,16 +4,16 @@
 
 <hibernate-mapping>
     <!-- Needs a identifier of type Long and no minimal constructor -->
-    <class name="ObjIdNoMin">
+    <class name="codegen.test.ObjIdNoMin">
         <id name="id" type="long" unsaved-value="null">
             <generator class="vm.long"/>
         </id>
         <property name="one" type="string" not-null="true"/>
-        <many-to-one name="two" class="ClassB" not-null="true"/>
+        <many-to-one name="two" class="codegen.test.ClassB" not-null="true"/>
     </class>
     
     <!-- Needs constructors including the identifier and no minimal constructor -->
-    <class name="ConstructorIdNoMin">
+    <class name="codegen.test.ConstructorIdNoMin">
         <id name="id" type="long">
             <generator class="assigned"/>
         </id>
@@ -21,7 +21,7 @@
     </class>
     
     <!-- Needs a constructor including the identifier and a minimal constructor --> 
-    <class name="ConstructorIdAndMin">
+    <class name="codegen.test.ConstructorIdAndMin">
         <id name="id" type="long">
             <generator class="assigned"/>
         </id>
@@ -29,7 +29,7 @@
     </class>
     
     <!-- Need both full and minimal constructor, includes a collection -->
-    <class name="BothConstructors">
+    <class name="codegen.test.BothConstructors">
         <id name="id" type="string">
             <generator class="uuid.hex"/>
         </id>
@@ -37,36 +37,36 @@
         <property name="two" type="string"/>
         <set role="recursiveColl">
             <key type="long" column="bcid"/>
-            <one-to-many class="BothConstructors"/>
+            <one-to-many class="codegen.test.BothConstructors"/>
         </set>
     </class>
 
     <!-- dummy classes to make the test complete -->
     <!-- also tests support for classes with no properties -->
-    <class name="ClassB">
+    <class name="codegen.test.ClassB">
       <id name="id" type="int">
       <generator class="uuid.hex"/>
       </id>
     </class>
 
-    <class name="ClassA">
+    <class name="codegen.test.ClassA">
       <id name="id" type="int">
       <generator class="uuid.hex"/>
       </id>
     </class>
  
-    <class name="CompositeIdClass">
-        <composite-id name="composite" class="CompositeId">
-            <key-many-to-one name="classA" class="ClassA"/>
+    <class name="codegen.test.CompositeIdClass">
+        <composite-id name="composite" class="codegen.test.CompositeId">
+            <key-many-to-one name="classA" class="codegen.test.ClassA"/>
             <key-property name="name" type="string"/>
         </composite-id>
         <property name="address" type="string" not-null="true"/>
         <property name="longValue" type="java.lang.Long"/>
     </class>
     
-    <class name="EmbeddedCompositeIdClass">
+    <class name="codegen.test.EmbeddedCompositeIdClass">
         <composite-id>
-            <key-many-to-one name="classA" class="ClassA"/>
+            <key-many-to-one name="classA" class="codegen.test.ClassA"/>
             <key-property name="name" type="string"/>
         </composite-id>
         <property name="address" type="string" not-null="true"/>
