Hello!

Am Dienstag, 10. April 2007 19:17 schrieb Abe White:
> I can't reproduce this.  When I leave out the @Persistent annotation
> on the field or replace it with @Basic, I do indeed end up with a
> binary column.  But if I correctly include the @Persistent annotation
> along with the @Externalizer, I get a varchar column.  Can you narrow
> down your entity to the smallest possible class that exhibits the
> problem and post it to the list so we can try to reproduce the error?

Finally it works. After I've reduced the project to one class with
one field and using derby as DB the problem was still the same. So
I found the problem in the ant-file that did the enhance and mapping
tasks.
But I don't understand the problem - maybe you have an explaination.
The problem was the entry '<pathelement path="${java.class.path}"/>' in
the element <classpath>. After I removed this line in both tasks it worked.

Here is the ant-file:
---
<project name="openjpa-test" default="refresh">
    <description>JPA test</description>
    
    <target name="enhance">
      <taskdef name="openjpac" 
classname="org.apache.openjpa.ant.PCEnhancerTask"/>
      <openjpac>
        <config propertiesFile="META-INF/persistence.xml"/>
        <fileset dir="${basedir}">
          <include name="domain/*.java" />
        </fileset>
        <classpath>
           <pathelement location="${basedir}"/>
           <pathelement path="${java.class.path}"/>
        </classpath>
      </openjpac>
    </target>

    <target name="refresh" depends="enhance">
      <taskdef name="mappingtool" 
classname="org.apache.openjpa.jdbc.ant.MappingToolTask"/>
      <mappingtool action="buildSchema">
        <config propertiesFile="META-INF/persistence.xml"/>
        <fileset dir="${basedir}">
          <include name="domain/*.java" />
        </fileset>
        <classpath>
           <pathelement location="${basedir}/"/>
           <pathelement path="${java.class.path}"/>
        </classpath>
      </mappingtool>
    </target>
</project>
---

my classpath is:
lib/commons-collections-3.2.jar
lib/commons-lang-2.1.jar
lib/commons-logging-1.0.4.jar
lib/commons-pool-1.3.jar
lib/derby-10.2.2.0.jar
lib/geronimo-j2ee-connector_1.5_spec-1.0.1.jar
lib/geronimo-jms_1.1_spec-1.0.1.jar
lib/geronimo-jpa_3.0_spec-1.0.jar
lib/geronimo-jta_1.0.1B_spec-1.0.1.jar
lib/openjpa-all-0.9.7-incubating-SNAPSHOT.jar
lib/postgresql-8.1-408.jdbc3.jar
lib/serp-1.11.0.jar

Thanks for your help
Lukas

Reply via email to