openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tierney, Mary K (GE Healthcare)" <>
Subject Trouble with persistent element (extended schema) when field name does not match column name
Date Wed, 30 Apr 2014 14:09:16 GMT
I have the following:

public abstract class Person {
                protected Boolean isActive;

Person table with column "IsInactiveFLAG" - char(1)

I am trying to use the Externalizer/Factory combo to transform the value into a Boolean for
use in code.

In my orm.xml file (using the extended schema), I have the following:

<basic name="isActive">
                                                                <orm:column name="IsInactiveFLAG"
                                                                <openjpa:persistent name="isActive"

I get the following error at runtime:

...Person.isActive" declares column "isActive", but this column does not exist in table "dbo.PERSON"
at org.apache.openjpa.jdbc.meta.MappingInfo.mergeColumn(
                at org.apache.openjpa.jdbc.meta.MappingInfo.createColumns(
                at org.apache.openjpa.jdbc.meta.ValueMappingInfo.getColumns(
                at org.apache.openjpa.jdbc.meta.FieldMapping.setStrategy(
                at org.apache.openjpa.jdbc.meta.RuntimeStrategyInstaller.installStrategy(
                at org.apache.openjpa.jdbc.meta.FieldMapping.resolveMapping(
                at org.apache.openjpa.jdbc.meta.FieldMapping.resolve(
                at org.apache.openjpa.jdbc.meta.ClassMapping.resolveNonRelationMappings(
                at org.apache.openjpa.jdbc.meta.MappingRepository.prepareMapping(
                at org.apache.openjpa.meta.MetaDataRepository.preMapping(
                at org.apache.openjpa.meta.MetaDataRepository.resolve(
                at org.apache.openjpa.meta.MetaDataRepository.getMetaDataInternal(
                at org.apache.openjpa.meta.MetaDataRepository.getMetaData(
                at org.apache.openjpa.persistence.meta.MetamodelImpl.<init>(
                at org.apache.openjpa.persistence.EntityManagerFactoryImpl.getMetamodel(
                at org.apache.openjpa.persistence.EntityManagerFactoryImpl.getMetamodel(

When I use attributes in the class, this all works fine.

Do I have to have matching field/column names in order to use this functionality in my orm.xml?
Please let me know if more information would be helpful.


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message