2017-03-23 1 views
1

현재 기존 db를 사용하는 대신 jpa 엔티티에서 jooq 클래스를 생성하려고합니다. 생성되지 않습니다 jooq 클래스 받는다는 패키지를 실행하지만 예상 할 때 성공을 생성 JPADatabase를 사용하여 H2에서 Jooq 클래스를 생성 할 수 없습니다.

<profile> 
      <id>jooq-jpa</id> 
      <build> 
       <plugins> 
        <plugin> 
         <groupId>org.apache.maven.plugins</groupId> 
         <artifactId>maven-compiler-plugin</artifactId> 
         <configuration> 
          <source>1.8</source> 
          <target>1.8</target> 
         </configuration> 
        </plugin> 
        <plugin> 
         <groupId>org.jooq</groupId> 
         <artifactId>jooq-codegen-maven</artifactId> 
         <version>${jooq.version}</version> 

         <dependencies> 
          <dependency> 
           <groupId>org.jooq</groupId> 
           <artifactId>jooq-meta-extensions</artifactId> 
           <version>${jooq.version}</version> 
          </dependency> 
         </dependencies> 

         <executions> 
          <execution> 
           <goals> 
            <goal>generate</goal> 
           </goals> 
          </execution> 
         </executions> 

         <configuration> 
          <logging>INFO</logging> 

          <generator> 
           <database> 
            <name>org.jooq.util.jpa.JPADatabase</name> 
            <includes>.*</includes> 
            <excludes></excludes> 
            <properties> 
             <property> 
              <key>packages</key> 
              <value>my.entity</value> 
             </property> 
            </properties> 
           </database> 
           <target> 
            <packageName>com.myentity.jooq</packageName> 
            <directory>${project.build.directory}/generated-sources/jooq</directory> 
           </target> 
          </generator> 
         </configuration> 
        </plugin> 
       </plugins> 
      </build> 
     </profile> 

이가하는

처럼

는 다음이 page 및 버전 3.9.1을 jooq 사용하여, 내 현재의 치어의 플러그인 섹션을 찾습니다. 빌드의 스택 추적을 보여줍니다 :

[INFO] ARRAYs fetched   : 0 (0 included, 0 excluded) 
[INFO] Enums fetched   : 0 (0 included, 0 excluded) 
[INFO] Packages fetched   : 0 (0 included, 0 excluded) 
[INFO] Routines fetched   : 0 (0 included, 0 excluded) 
[INFO] Tables fetched   : 0 (0 included, 0 excluded) 
[INFO] UDTs fetched    : 0 (0 included, 0 excluded) 
[INFO] Excluding empty catalog : 
[INFO] Removing excess files 
+0

하여 JPA-주석 실체가에 있습니까 :이 명확히하기 위해 설명서를 개선하기 위해 문제를 등록한

 +-------------------+ | Your JPA entities | +-------------------+ ^ ^ depends on | | depends on | | +---------------------+ +---------------------+ | jOOQ codegen plugin | | Your application | +---------------------+ +---------------------+ | | generates | | depends on v v +-------------------------+ | jOOQ generated classes | +-------------------------+ 

:

이 솔루션은 다음과 같은 모듈 종속성 그래프를 생성하는 것입니다 jOOQ 코드 생성기 플러그인의 classpath? 나는. jOOQ 코드를 생성하기 전에 * 컴파일 되었습니까? –

+0

번. 플러그인 설정이있는 동일한 모듈의 일부입니다. 발전기를 가동하기 전에 컴파일해야합니까? – geneqew

+0

플러그인을 실행하기 전에 컴파일 된 엔티티로 테스트하여 작동했습니다. 잔뜩 고마워요 @ LukasEder. 당신이 대답으로 게시 할 수 있도록 내가 그것을 허용으로 표시하고 동일한 문제가 발생할 수있는 다른 사람을 도와 줄래? – geneqew

답변

1

귀하의 실체는 아마 당신이 플러그인을 어디다와 같은 모듈에 있습니다. 이것은 jOOQ 코드 생성기가 모듈을 컴파일하기 전에 호출된다는 것을 의미합니다. 즉, JPA 주석 처리 된 엔티티는 jOOQ 코드 생성기가 모듈을 찾을 때 아직 컴파일되지 않았습니다. https://github.com/jOOQ/jOOQ/issues/6011