Re: How to set the type of the DB-field using @Externalizer
I'm trying to use the @Externalizer annotation but have problems with the resulting type of the DB-field - it's always a byte-array. You shouldn't need the @Type annotation -- the type will be inferred from the return type of the externalizer method. Are you dropping the database table in between attempts? It's possible that if your first attempt resulted in a byte array column because of some misconfiguration, OpenJPA will think it is supposed to reuse that column on subsequent mapping attempts, because technically it can fit anything in a byte-array column. Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.
Re: How to set the type of the DB-field using @Externalizer
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? Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.
Re: How to set the type of the DB-field using @Externalizer
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 descriptionJPA 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