Examples of GenericExporter


Examples of com.mysema.query.codegen.GenericExporter

public class GenericExporterTest {

    @Test
    public void test() {
        GenericExporter exporter = new GenericExporter();
        exporter.setTargetFolder(new File("target/" + GenericExporterTest.class.getSimpleName()));
        exporter.export(getClass().getPackage());
    }
View Full Code Here

Examples of com.mysema.query.codegen.GenericExporter

    public void Execute() throws IOException {
        // via APT
        process(QuerydslAnnotationProcessor.class, CLASSES, "QuerydslAnnotationProcessor");

        // via GenericExporter
        GenericExporter exporter = new GenericExporter();
        exporter.setTargetFolder(new File("target/GenericExporterTest"));
        exporter.export(AbstractEntityTest.class.getPackage());

        List<String> expected = new ArrayList<String>();
        // delegates are not supported
        expected.add("QDelegateTest_SimpleUser.java");
        expected.add("QDelegateTest_SimpleUser2.java");
View Full Code Here

Examples of com.mysema.query.codegen.GenericExporter

    public void Execute2() throws IOException {
        // via APT
        process(HibernateAnnotationProcessor.class, CLASSES, "HibernateAnnotationProcessor");

        // via GenericExporter
        GenericExporter exporter = new GenericExporter();
        exporter.setKeywords(Keywords.JPA);
        exporter.setEntityAnnotation(Entity.class);
        exporter.setEmbeddableAnnotation(Embeddable.class);
        exporter.setEmbeddedAnnotation(Embedded.class);
        exporter.setSupertypeAnnotation(MappedSuperclass.class);
        exporter.setSkipAnnotation(Transient.class);
        exporter.setTargetFolder(new File("target/GenericExporterTest2"));
        exporter.addStopClass(ForwardingSet.class);
        exporter.setStrictMode(true);
        exporter.export(AbstractEntityTest.class.getPackage());

        List<String> expected = new ArrayList<String>();
        // GenericExporter doesn't include field/method selection
        expected.add("QFileAttachment.java");
        expected.add("QJodaTest_BaseEntity.java");
View Full Code Here

Examples of com.mysema.query.codegen.GenericExporter

        execute(expected, "GenericExporterTest2", "HibernateAnnotationProcessor");
    }

    @Test
    public void Execute3() {
        GenericExporter exporter = new GenericExporter();
        exporter.setKeywords(Keywords.JPA);
        exporter.setEntityAnnotation(Entity.class);
        exporter.setEmbeddableAnnotation(Embeddable.class);
        exporter.setEmbeddedAnnotation(Embedded.class);
        exporter.setSupertypeAnnotation(MappedSuperclass.class);
        exporter.setSkipAnnotation(Transient.class);
        exporter.setTargetFolder(new File("target/GenericExporterTest3"));
        //exporter.addStopClass(ForwardingSet.class);
        exporter.export(CustomCollection.MyCustomCollection.class,
                        CustomCollection.MyCustomCollection2.class,
                        CustomCollection.MyEntity.class);
    }
View Full Code Here

Examples of com.mysema.query.codegen.GenericExporter

                        CustomCollection.MyEntity.class);
    }

    @Test
    public void Execute4() throws IOException {
        GenericExporter exporter = new GenericExporter();
        exporter.setKeywords(Keywords.JPA);
        exporter.setEntityAnnotation(Entity.class);
        exporter.setEmbeddableAnnotation(Embeddable.class);
        exporter.setEmbeddedAnnotation(Embedded.class);
        exporter.setSupertypeAnnotation(MappedSuperclass.class);
        exporter.setSkipAnnotation(Transient.class);
        exporter.setTargetFolder(new File("target/GenericExporterTest4"));
        exporter.addStopClass(ForwardingSet.class);
        exporter.export(Generic2Test.class.getClasses());
    }
View Full Code Here

Examples of com.mysema.query.codegen.GenericExporter

        } catch (DependencyResolutionRequiredException e) {
            throw new MojoFailureException(e.getMessage(), e);
        }

        Charset charset = sourceEncoding != null ? Charset.forName(sourceEncoding) : Charset.defaultCharset();
        GenericExporter exporter = new GenericExporter(classLoader, charset);
        exporter.setTargetFolder(targetFolder);

        if (scala) {
            try {
                exporter.setSerializerClass((Class<? extends Serializer>) Class
                        .forName("com.mysema.query.scala.ScalaEntitySerializer"));
                exporter.setTypeMappingsClass((Class<? extends TypeMappings>) Class
                        .forName("com.mysema.query.scala.ScalaTypeMappings"));
                exporter.setCreateScalaSources(true);
            } catch (ClassNotFoundException e) {
                throw new MojoFailureException(e.getMessage(), e);
            }
        }

        configure(exporter);
        exporter.export(packages);
    }
View Full Code Here

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

Examples of org.hibernate.tool.hbm2x.GenericExporter

 
  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

Examples of org.hibernate.tool.hbm2x.GenericExporter

     */
    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

Examples of org.hibernate.tool.hbm2x.GenericExporter

            } 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
TOP
Copyright © 2018 www.massapi.com. 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.