openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Dick (Commented) (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (OPENJPA-1957) XML overriding column names for ArrayList attributes causes exception.
Date Sat, 21 Jan 2012 16:47:42 GMT

    [ https://issues.apache.org/jira/browse/OPENJPA-1957?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13190462#comment-13190462
] 

Michael Dick commented on OPENJPA-1957:
---------------------------------------

I'd need to see the testcase to comment. From memory, there's nothing functionally different
between the changes in 1.2.x or any other release. The annotation parser class was refactored
for new annotations in JPA 2.0 and I just slotted this code around that. 


                
> XML overriding column names for ArrayList attributes causes exception.
> ----------------------------------------------------------------------
>
>                 Key: OPENJPA-1957
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1957
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jdbc
>    Affects Versions: 1.2.2, 2.0.1, 2.1.0
>            Reporter: Heath Thomann
>            Assignee: Michael Dick
>            Priority: Minor
>             Fix For: 1.2.3, 2.0.2, 2.1.1, 2.2.0
>
>
> 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"/>
> 		<attributes>
> 			<id name="_id">
> 				<column name="MYENTITY_ID" nullable="false" />
> 			</id>
>           <basic name="myStrings">
>             <column name="MY_STRINGS"/>
>             <lob/>
>          </basic>
> 		</attributes>
> 	</entity>
> 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(MappingInfo.java:327)
> 	at org.apache.openjpa.jdbc.meta.strats.HandlerFieldStrategy.map(HandlerFieldStrategy.java:77)
> 	at org.apache.openjpa.jdbc.meta.FieldMapping.setStrategy(FieldMapping.java:121)
> 	at org.apache.openjpa.jdbc.meta.RuntimeStrategyInstaller.installStrategy(RuntimeStrategyInstaller.java:80)
> 	at org.apache.openjpa.jdbc.meta.FieldMapping.resolveMapping(FieldMapping.java:454)
> 	at org.apache.openjpa.jdbc.meta.FieldMapping.resolve(FieldMapping.java:419)
> 	at org.apache.openjpa.jdbc.meta.ClassMapping.resolveNonRelationMappings(ClassMapping.java:881)
> 	at org.apache.openjpa.jdbc.meta.MappingRepository.prepareMapping(MappingRepository.java:418)
> ..............

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message