[ 
https://issues.apache.org/jira/browse/OPENJPA-1481?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Rick Curtis updated OPENJPA-1481:
---------------------------------

    Attachment: OPENJPA-1481--test.zip

I boiled the previous testcase down to the minimum needed to hit the error.  
I'm not sure what the *proper* solution is, but I was able to make the problem 
go away.

It looks like the root issue has to do with the following mapping:
    <one-to-many name="childItems" target-entity="PriceList">
        <join-column name="PRICE_LIST_ID" 
referenced-column-name="PRICE_LIST_ID"/>
    </one-to-many>
com\att\ecom\dynamiccontent\domain\pricelist\orm.xml

If you remove the name or referenced-column-name, the problem goes away(I'm not 
sure if that is the proper solution or not). I don't think that preloading is 
the cause of the problem, it is merely exposing a mapping problem (or OpenJPA 
bug?).

> metadata preload thinks a varchar column is a blob
> --------------------------------------------------
>
>                 Key: OPENJPA-1481
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1481
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jpa
>    Affects Versions: 1.2.2
>            Reporter: David M. Karr
>         Attachments: jpatestcase.zip, OPENJPA-1481--test.zip, 
> TEST-com.att.ecom.dynamiccontent.content.CategoryJPATest.txt
>
>
> Without metadata preload on, my application is working fine. When I turned on 
> metadata preload, creating the factory fails with an error like this:
> -------------------
> Caused by: <openjpa-1.2.2-r422266:898935 fatal user error> 
> org.apache.openjpa.persistence.ArgumentException: 
> "com.att.ecom.dynamiccontent.domain.pricelist.PriceListFolder.childItems<element:class
>  com.att.ecom.dynamiccontent.domain.pricelist.PriceList>" declares a column 
> that is not compatible with the expected type "blob".  Column details:
> Full Name: DCS_PRICE_LIST.PRICE_LIST_ID
> Type: varchar
> Size: 255
> Default: null
> Not Null: false
> -------------------
> This error message is from the unit test output, which uses Derby.  My 
> application normally uses Oracle.  The only difference in the error message 
> between the unit test with Derby and at runtime with Oracle is the type is 
> "varchar2" (Derby only has varchar).
> The excerpt from the orm.xml for this property is this:
>             <id name="id">
>                 <column name="PRICE_LIST_ID"/>
>             </id>
> And from the domain class:
>     @Id
>     private String          id;
> I'm going to attach the "TEST" output file from the build which shows the 
> error message and stack trace.  I'm also going to attach a zip file 
> containing an Eclipse project, but the "lib" and "libtest" directories will 
> only have a "jars.lst" text file containing the names of the jars that were 
> in that directory (almost all of which have a version number in the name).  
> Note that not all of the jars in those lists are required for the unit test 
> to complete.  Some of the jars in the list are required for the CXF and 
> Spring portion of the application, so wouldn't be necessary for this test 
> case.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to