Package org.hibernate.tool.hbm2x

Examples of org.hibernate.tool.hbm2x.GenericExporter


    this.exporterClass = exporterClass;
  }
 
  protected Exporter createExporter() {
    if (exporterClass == null) {
      return new GenericExporter();
    } else {
      try {
        Class theClass = ReflectHelper.classForName(exporterClass);
        return (Exporter) theClass.newInstance();
      } catch (ClassNotFoundException e) {
View Full Code Here


 
  protected Exporter configureExporter(Exporter exp) {
    super.configureExporter(exp);
   
    if(exp instanceof GenericExporter) {
      GenericExporter exporter = (GenericExporter) exp;
      if(filePattern!=null) exporter.setFilePattern(filePattern);
      if(templateName!=null) exporter.setTemplateName(templateName);
      if(forEach!=null) exporter.setForEach(forEach);
    }
   
    return exp;
  }
View Full Code Here

     */
    protected Exporter configureExporter(Exporter exporter) throws MojoExecutionException {
        super.configureExporter(exporter);

        if (exporter instanceof GenericExporter) {
            GenericExporter ge = (GenericExporter) exporter;
            ge.setFilePattern(getComponentProperty("filepattern"));
            ge.setTemplateName(getComponentProperty("template"));
        }

        return exporter;
    }
View Full Code Here

            } else {
                getLog().error("Could not create custom exporter class: " + exporterClass);
            }
        }
        getLog().info("Using exporter class org.hibernate.tool.hbm2x.GenericExporter");
        return new GenericExporter();
    }
View Full Code Here

            }
        } else {
            templatePaths = getTemplatePaths();  
        }

        GenericExporter exporter = new GenericExporter(getConfiguration(), getOutputDirectory()) {
            @Override
            protected void exportPOJO(Map map, POJOClass element) {
                if (element.getShortName().equals(System.getProperty("appfuse.entity"))) {
                    super.exportPOJO(map, element);
                }
            }

            @Override
            protected String resolveFilename(POJOClass element) {
                String filename = super.resolveFilename(element);
                String packageLocation = getPackageNameForFile(element).replace(".", "/");

                String pojoName = System.getProperty("entity");
                if (pojoName == null) {
                    pojoName = System.getProperty("appfuse.entity");
                }

                // A dot in the entity name means the person is specifying the package.
                if (pojoName.contains(".")) {
                    packageLocation = pojoName.substring(0, pojoName.indexOf(".model"));
                    packageLocation = packageLocation.replace(".", "/");
                }

                if (packageLocation.endsWith("model") && packageLocation.indexOf('/') > -1) {
                    packageLocation = packageLocation.substring(0, packageLocation.lastIndexOf('/'));
                }
                filename = filename.replace("{basepkg-name}", packageLocation);
                return filename;
            }
        };
        exporter.setProperties((Properties) getProperties().clone());
        exporter.setTemplatePath(templatePaths);
        exporter.setTemplateName(template);
        exporter.setFilePattern(pattern);
        exporter.setArtifactCollector(getArtifactCollector());
        exporter.getProperties().put("data", new DataHelper());
        exporter.getProperties().put("util", new StringUtils());

        return exporter;
    }
View Full Code Here

            }
        } else {
            templatePaths = getTemplatePaths();
        }

        GenericExporter exporter = new GenericExporter(getConfiguration(),
                getOutputDirectory()) {
            @Override
            protected void exportPOJO(Map map, POJOClass element) {
                if (element.getShortName().contains(
                        System.getProperty("appfuse.entity"))) {
                    super.exportPOJO(map, element);
                }
            }

            @Override
            protected String resolveFilename(POJOClass element) {
                String filename = super.resolveFilename(element);
                String packageLocation = StringHelper.replace(
                        getPackageNameForFile(element), ".", "/");
                if (packageLocation.endsWith("model")
                        && packageLocation.indexOf('/') > -1) {
                    packageLocation = packageLocation.substring(0,
                            packageLocation.lastIndexOf('/'));
                }
                filename = StringHelper.replace(filename, "{basepkg-name}",
                        packageLocation);
                return filename;
            }
        };

        exporter.setProperties((Properties) getProperties().clone());
        exporter.setTemplatePath(templatePaths);
        exporter.setTemplateName(template);
        exporter.setFilePattern(pattern);
        exporter.setArtifactCollector(getArtifactCollector());
        exporter.getProperties().put("data", new DataHelper());
        exporter.getProperties().put("util", new StringUtils());

        return exporter;
    }
View Full Code Here

    protected Exporter configureExporter(Exporter exporter)
            throws MojoExecutionException {
        super.configureExporter(exporter);

        if (exporter instanceof GenericExporter) {
            GenericExporter ge = (GenericExporter) exporter;
            ge.setFilePattern(getComponentProperty("filepattern"));
            ge.setTemplateName(getComponentProperty("template"));
        }

        return exporter;
    }
View Full Code Here

            }
        }
        getLog()
                .info(
                        "Using exporter class org.hibernate.tool.hbm2x.GenericExporter");
        return new GenericExporter();
    }
View Full Code Here

    this.exporterClass = exporterClass;
  }
 
  protected Exporter createExporter() {
    if (exporterClass == null) {
      return new GenericExporter();
    } else {
      try {
        Class theClass = ReflectHelper.classForName(exporterClass);
        return (Exporter) theClass.newInstance();
      } catch (ClassNotFoundException e) {
View Full Code Here

 
  protected Exporter configureExporter(Exporter exp) {
    super.configureExporter(exp);
   
    if(exp instanceof GenericExporter) {
      GenericExporter exporter = (GenericExporter) exp;
      if(filePattern!=null) exporter.setFilePattern(filePattern);
      if(templateName!=null) exporter.setTemplateName(templateName);
      if(forEach!=null) exporter.setForEach(forEach);
    }
   
    return exp;
  }
View Full Code Here

TOP

Related Classes of org.hibernate.tool.hbm2x.GenericExporter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.