Create Maven plugin goal for GenericExporter execution #138

Closed
timowest opened this Issue May 3, 2012 · 2 comments

Comments

Projects
None yet
1 participant
@timowest
Member

timowest commented May 3, 2012

Scala example:

import com.mysema.query.jpa.impl.JPAQuery
import com.mysema.query.scala.{ScalaEntitySerializer, ScalaTypeMappings}
import javax.persistence.Embeddable
import javax.persistence.Embedded
import javax.persistence.Entity
import javax.persistence.MappedSuperclass
import javax.persistence.Transient 
import com.mysema.query.codegen.GenericExporter

val exporter = new GenericExporter()
exporter.setTargetFolder(new java.io.File("target/generated-sources/queryDSL"))
exporter.setSerializerClass(classOf[ScalaEntitySerializer])
exporter.setTypeMappingsClass(classOf[ScalaTypeMappings])
exporter.setEmbeddableAnnotation(classOf[Embeddable])
exporter.setEmbeddedAnnotation(classOf[Embedded])
exporter.setEntityAnnotation(classOf[Entity])
exporter.setSkipAnnotation(classOf[Transient])
exporter.setSupertypeAnnotation(classOf[MappedSuperclass])
exporter.setCreateScalaSources(true)
exporter.export("yourpackage")

timowest added a commit that referenced this issue May 4, 2012

timowest added a commit that referenced this issue May 4, 2012

timowest added a commit that referenced this issue May 4, 2012

timowest added a commit that referenced this issue May 5, 2012

@timowest

This comment has been minimized.

Show comment
Hide comment
@timowest

timowest May 5, 2012

Member

Scala example

  <plugin>
    <groupId>com.mysema.querydsl</groupId>
    <artifactId>querydsl-maven-plugin</artifactId>
    <version>${project.version}</version>
    <configuration>
      <testClasspath>true</testClasspath>
      <targetFolder>target/genericExporter</targetFolder>
      <scala>true</scala>
      <packages>
        <package>com.mysema.query.scala</package>
      </packages>
    </configuration>
    <dependencies>
      <dependency>
        <groupId>com.mysema.querydsl</groupId>
        <artifactId>querydsl-scala</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>org.scala-lang</groupId>
        <artifactId>scala-library</artifactId>
        <version>${scala.version}</version>
      </dependency>
    </dependencies>
  </plugin>   
Member

timowest commented May 5, 2012

Scala example

  <plugin>
    <groupId>com.mysema.querydsl</groupId>
    <artifactId>querydsl-maven-plugin</artifactId>
    <version>${project.version}</version>
    <configuration>
      <testClasspath>true</testClasspath>
      <targetFolder>target/genericExporter</targetFolder>
      <scala>true</scala>
      <packages>
        <package>com.mysema.query.scala</package>
      </packages>
    </configuration>
    <dependencies>
      <dependency>
        <groupId>com.mysema.querydsl</groupId>
        <artifactId>querydsl-scala</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>org.scala-lang</groupId>
        <artifactId>scala-library</artifactId>
        <version>${scala.version}</version>
      </dependency>
    </dependencies>
  </plugin>   

timowest added a commit that referenced this issue May 5, 2012

@timowest

This comment has been minimized.

Show comment
Hide comment
@timowest

timowest May 25, 2012

Member

Released in 2.6.0

Member

timowest commented May 25, 2012

Released in 2.6.0

@timowest timowest closed this May 25, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment