openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David M. Karr (JIRA)" <j...@apache.org>
Subject [jira] Commented: (OPENJPA-1481) metadata preload thinks a varchar column is a blob
Date Fri, 11 Jun 2010 15:50:13 GMT

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

David M. Karr commented on OPENJPA-1481:
----------------------------------------

I appear to be hitting something related to this again.  I'm not using preload.  I've even
pruned out some of the entities and properties that I don't need. This particular "orm.xml"
file sort of sat idle for a while, but I just added a relationship from one entity in another
orm.xml file that I've been working on steadily, to an entity in this "pricelist" orm.xml
file.  The new relationship is "non-standard", as I had to use a "constant join" (described
in the "Non-Standard Joins" section of the doc).

All of my orm.xml files are specified in the persistence.xml file.

I get the following error at runtime (eliding some package paths):

"...Sku.discount" declares a column that is not compatible with the expected type "blob".
 Column details:
Full Name: DCS_SKU.SKU_ID
Type: varchar
Size: 255
Default: null
Not Null: false

The two new mappings I added to the "Sku" entity today are the following (this error started
when I added these):

            <one-to-one name="price" target-entity="...Price">
                <join-column name="SKU_ID" referenced-column-name="SKU_ID"/>
                <join-column name="PRICE_LIST" referenced-column-name="'US_PLR'"/>
            </one-to-one>
            <one-to-one name="discount" target-entity="...Price">
                <join-column name="SKU_ID" referenced-column-name="SKU_ID"/>
                <join-column name="PRICE_LIST" referenced-column-name="'SALE_US_PLR'"/>
            </one-to-one>

The "Price" mapping in the other orm.xml file is:

    <entity name="Price" class="...Price">
        <table name="DCS_PRICE"/>
        <attributes>
            <id name="id">
                <column name="PRICE_ID"/>
            </id>
            <basic name="listPrice">
                <column name="LIST_PRICE"/>
            </basic>
        </attributes>
    </entity>

Just in case, I tried commenting out the "discount" property, but that just changed the error
message to refer to the "price" property.

> 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.


Mime
View raw message