Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • persistence.xml is ignored, the plug-in / builder only looks for annotations annotations (@Entity, @MappedSuperclass, @Embeddable, @ManagedInterface) to decide if a class actually needs enhancement

Options

  • ... **/*Entity.java ...

...

  • error markers (the lines shown in the Problems view) are on the .class resource, instead of on the source .java class, which would be more convenient
  • the Builder runs even on classes which are red and compilation issues, because the Eclipse compiler still tries to produce a .class file, and may log weird error messages in that case

Troubleshooting

  • If the Builder has trouble during enhancement, it often logs useful messages / exception stack traces to the Eclipse Error Log. Use menu Window > Show View > Error Log to display it. If you don't have the Error Log view, this could be because you have an Eclipse with the PDE (Plug-in Development Environment), get that. The Eclipse Error Log can also be exported from this view, e.g. to send it to the mailing list.
  • If your Eclipse dies due to "java.lang.OutOfMemoryError: Java heap space" / "java.lang.OutOfMemoryError: PermGen space" issues, you may need to add e.g. "-XX:PermSize=64m -XX:MaxPermSize=256m -Xms128m -Xmx512m" to your eclipse.ini (each option on a separate line) for the enhancement builder

Options

  • The builder has been written with efficiency in mind and profiled, e.g. it correctly does only Incremental Builds if possible. However, for projects with a lot of classes, this Builder may slow down the project. This is because it still has to byte-code inspect (load and analyze) each .class to determine if it needs enhancement. If the JPA entities in your project follow some naming convention (e.g. all ending in *Entity, or all in a certain package), then the builder can be configured to "match" only certain classes using Ant-like patterns, by manually adding the following to the existing .project file of the Eclipse Java project:
Code Block
xml
xml

<projectDescription>
...
    <buildSpec>
...
        <buildCommand>
            <name>org.apache.openjpa.eclipse.OpenJPAEnhancerBuilder</name>
            <arguments>
                <dictionary>
                    <key>debugLogs</key>
                    <value>false</value>
                </dictionary>
                <dictionary>
                    <key>include1</key>
                    <value>**/*Entity.class</value>
                </dictionary>
                <dictionary>
                    <key>include2</key>
                    <value>**/*EntityRef.class</value>
                </dictionary>
  • More verbose logging can ...