Search in sources :

Example 6 with BeanSerializer

use of com.querydsl.codegen.BeanSerializer in project querydsl by querydsl.

the class MetaDataExporterTest method minimal_configuration_with_bean_prefix.

@Test
public void minimal_configuration_with_bean_prefix() throws SQLException {
    MetaDataExporter exporter = new MetaDataExporter();
    exporter.setSchemaPattern("PUBLIC");
    exporter.setPackageName("test");
    exporter.setNamePrefix("");
    exporter.setBeanPrefix("Bean");
    exporter.setBeanSerializer(new BeanSerializer());
    exporter.setTargetFolder(folder.getRoot());
    exporter.export(metadata);
    assertTrue(new File(folder.getRoot(), "test/DateTest.java").exists());
    assertTrue(new File(folder.getRoot(), "test/BeanDateTest.java").exists());
}
Also used : BeanSerializer(com.querydsl.codegen.BeanSerializer) File(java.io.File)

Example 7 with BeanSerializer

use of com.querydsl.codegen.BeanSerializer in project querydsl by querydsl.

the class MetaDataExporterTest method minimal_configuration_with_bean_suffix.

@Test
public void minimal_configuration_with_bean_suffix() throws SQLException {
    MetaDataExporter exporter = new MetaDataExporter();
    exporter.setSchemaPattern("PUBLIC");
    exporter.setPackageName("test");
    exporter.setNamePrefix("");
    exporter.setBeanSuffix("Bean");
    exporter.setBeanSerializer(new BeanSerializer());
    exporter.setTargetFolder(folder.getRoot());
    exporter.export(metadata);
    assertTrue(new File(folder.getRoot(), "test/DateTest.java").exists());
    assertTrue(new File(folder.getRoot(), "test/DateTestBean.java").exists());
}
Also used : BeanSerializer(com.querydsl.codegen.BeanSerializer) File(java.io.File)

Aggregations

BeanSerializer (com.querydsl.codegen.BeanSerializer)7 File (java.io.File)6 SimpleType (com.mysema.codegen.model.SimpleType)2 Configuration (com.querydsl.sql.Configuration)2 MetaDataExporter (com.querydsl.sql.codegen.MetaDataExporter)2 NumericMapping (com.querydsl.sql.codegen.support.NumericMapping)2 RenameMapping (com.querydsl.sql.codegen.support.RenameMapping)2 TypeMapping (com.querydsl.sql.codegen.support.TypeMapping)2 Connection (java.sql.Connection)2 SQLException (java.sql.SQLException)2 DefaultNamingStrategy (com.querydsl.sql.codegen.DefaultNamingStrategy)1 NamingStrategy (com.querydsl.sql.codegen.NamingStrategy)1 IOException (java.io.IOException)1 MojoExecutionException (org.apache.maven.plugin.MojoExecutionException)1 AuthenticationInfo (org.apache.maven.wagon.authentication.AuthenticationInfo)1 BuildException (org.apache.tools.ant.BuildException)1