Index: src/main/java/org/appfuse/mojo/exporter/AppFuseGeneratorMojo.java
===================================================================
--- src/main/java/org/appfuse/mojo/exporter/AppFuseGeneratorMojo.java	(révision 3075)
+++ src/main/java/org/appfuse/mojo/exporter/AppFuseGeneratorMojo.java	(copie de travail)
@@ -80,7 +80,10 @@
      * @noinspection UnusedDeclaration
      */
     private String templateDirectory;
-
+	/**
+	 * elaroche: get the full path for the model
+	 */
+	private String fullPath = null;
     /**
      * Default constructor.
      */
@@ -285,7 +288,19 @@
     }
 
     private void addEntityToHibernateCfgXml(String hibernateCfgXml) throws MojoFailureException {
-        String className = getProject().getGroupId() + ".model." + pojoName;
+
+        // String className = getProject().getGroupId() + ".model." + pojoName;
+        // elaroche
+		String className = getProject().getGroupId();
+		// elaroche: check if it's with the fullpath
+		if (fullPath != null) {
+			className += "." + fullPath + ".";
+		} else {
+			className += ".model.";
+		}
+		className += pojoName;
+		log("Constructed class name : " + className);
+        
         if (!hibernateCfgXml.contains(pojoName)) {
             // check that class exists and has an @Entity annotation
             checkEntityExists();
@@ -322,7 +337,18 @@
 
             // refactor to check classpath instead of filesystem
             String groupIdAsPath = getProject().getGroupId().replace(".", FILE_SEP);
-            File modelPackage = new File(pathToModelPackage + groupIdAsPath + FILE_SEP + "model");
+            //File modelPackage = new File(pathToModelPackage + groupIdAsPath + FILE_SEP + "model");
+            
+            			String fullPathPackage = pathToModelPackage + groupIdAsPath;
+			if (fullPath != null) {
+				fullPathPackage += FILE_SEP + fullPath.replace(".", FILE_SEP);
+			} else {
+				fullPathPackage += FILE_SEP + "model";
+			}
+			log("Looking for entity in " + fullPathPackage);
+			File modelPackage = new File(fullPathPackage);
+            
+            
             boolean entityExists = false;
 
             if (modelPackage.exists()) {
@@ -335,7 +361,7 @@
                     }
                 }
             } else {
-                getLog().error("The path '" + pathToModelPackage + groupIdAsPath + FILE_SEP + "model' does not exist!");
+                getLog().error("The path '" + fullPathPackage + "' does not exist!");
             }
 
             if (!entityExists) {
