OpenJPA
  1. OpenJPA
  2. OPENJPA-1382

make org.apache.openjpa.persistence.meta.AnnotationProcessor6 as service

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Duplicate
    • Affects Version/s: 2.0.0-M3
    • Fix Version/s: 2.0.0
    • Component/s: integration, tooling
    • Labels:
      None
    • Environment:
      windows XP,sun jdk6

      Description

      please add a file named "javax.annotation.processing.Processor" to META-INF/services
      file content is org.apache.openjpa.persistence.meta.AnnotationProcessor6

      otherwise we need specific classname use -processor argument

      reduce
      javac -processorpath openjpa-all-2.0.0-SNAPSHOT.jar -processor org.apache.openjpa.persistence.meta.AnnotationProcessor6 *.java
      to
      javac -processorpath openjpa-all-2.0.0-SNAPSHOT.jar *.java

        Activity

        Donald Woods made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Donald Woods made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 2.0.0 [ 12314019 ]
        Fix Version/s 2.1.0 [ 12314542 ]
        Resolution Duplicate [ 3 ]
        Hide
        Donald Woods added a comment -
        Show
        Donald Woods added a comment - See OPENJPA-1622
        Donald Woods made changes -
        Fix Version/s 2.1.0 [ 12314542 ]
        Fix Version/s 2.0.0 [ 12314019 ]
        Hide
        Pinaki Poddar added a comment -

        Hi,
        The option to plug meta-data generator tool as a service has been considered. But it was not activated it because we did not know how the users will react if pure javac compilation with OpenJPA library in compiler classpath starts generating a bunch of MyEntity_.java files.
        Our assumption is only a handful of brave users will start experimenting with new Criteria API and a subset of them will use the typesafe version that requires these automatically generated canonical classes. That is why, the automatic generation is not activated as service.

        But one is always wrong in making any assumption on usage pattern

        About location of the generated sources:
        Our first preference was to generate the new MyEnity_.java files in the same directory as in MyEntity.java, by default.
        But it is not obvious how to determine the directory location of a *.java files in the context an AnnotationProcessor is invoked. Nor the ways to access the javac options such as -sourcepath etc.
        After a discussion in this regard [1] and some basic experiments, I concluded that the location of MyEntity.java can only be determined with a specialized API in Sun JDK. Based on that observation, the default location of the generated files are current directory (for non-Sun JDK) and the directory of the original source for Sun JDK.

        [1] http://forums.sun.com/thread.jspa?threadID=5398594&tstart=0

        Show
        Pinaki Poddar added a comment - Hi, The option to plug meta-data generator tool as a service has been considered. But it was not activated it because we did not know how the users will react if pure javac compilation with OpenJPA library in compiler classpath starts generating a bunch of MyEntity_.java files. Our assumption is only a handful of brave users will start experimenting with new Criteria API and a subset of them will use the typesafe version that requires these automatically generated canonical classes. That is why, the automatic generation is not activated as service. But one is always wrong in making any assumption on usage pattern About location of the generated sources: Our first preference was to generate the new MyEnity_.java files in the same directory as in MyEntity.java, by default. But it is not obvious how to determine the directory location of a *.java files in the context an AnnotationProcessor is invoked. Nor the ways to access the javac options such as -sourcepath etc. After a discussion in this regard [1] and some basic experiments, I concluded that the location of MyEntity.java can only be determined with a specialized API in Sun JDK. Based on that observation, the default location of the generated files are current directory (for non-Sun JDK) and the directory of the original source for Sun JDK. [1] http://forums.sun.com/thread.jspa?threadID=5398594&tstart=0
        Kevin Sutter made changes -
        Assignee Pinaki Poddar [ ppoddar@apache.org ]
        Donald Woods made changes -
        Field Original Value New Value
        Original Estimate 10m [ 600 ]
        Remaining Estimate 10m [ 600 ]
        Fix Version/s 2.0.0 [ 12314019 ]
        Component/s integration [ 12312870 ]
        Component/s tooling [ 12312859 ]
        Hide
        zhouyanming added a comment - - edited

        It's works in eclipse also,but need to use absolute path,like -Aout=D:/workspace/helloworld/.apt_generated,or sources will generated in eclipse install directory

        Show
        zhouyanming added a comment - - edited It's works in eclipse also,but need to use absolute path,like -Aout=D:/workspace/helloworld/.apt_generated,or sources will generated in eclipse install directory
        zhouyanming created issue -

          People

          • Assignee:
            Pinaki Poddar
            Reporter:
            zhouyanming
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development