openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Heath Thomann (JIRA)" <>
Subject [jira] Created: (OPENJPA-1957) XML overriding column names for ArrayList attributes causes exception.
Date Wed, 09 Mar 2011 00:11:59 GMT
XML overriding column names for ArrayList attributes causes exception.

                 Key: OPENJPA-1957
             Project: OpenJPA
          Issue Type: Bug
          Components: jdbc
    Affects Versions: 2.1.0, 2.0.1, 1.2.2
            Reporter: Heath Thomann
            Assignee: Heath Thomann
            Priority: Minor

Take an entity class similar to the following:

public class MyEntity implements Serializable {
   protected String _id;
   protected ArrayList<String> myStrings = new ArrayList<String>();

and a corresponding XML mapping in orm.xml:

  	<entity class="somepackage.MyEntity" access="FIELD">
		<table name="MY_TABLE"/>
			<id name="_id">
				<column name="MYENTITY_ID" nullable="false" />
          <basic name="myStrings">
            <column name="MY_STRINGS"/>

With this configuration, the following exception can occur:

org.apache.openjpa.persistence.ArgumentException: You have supplied columns for "somepackage.MyEntity.myStrings<element:class
java.lang.String>", but this mapping cannot have columns in this context.
	at org.apache.openjpa.jdbc.meta.MappingInfo.assertNoSchemaComponents(
	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(

This message is automatically generated by JIRA.
For more information on JIRA, see:

View raw message