You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@openjpa.apache.org by Pinaki Poddar <pp...@apache.org> on 2009/02/13 02:02:03 UTC

Re: Strange error Please ensure that your database records are in the correct format

1. org.apache.renamed.openjpa.jdbc.meta.strats....

Why is the package name different?

2. From the stack trace, the field strategy looks suspicious. It may have
been related to the fact that someone renamed/refactored openjpa packages.

3. IANAL, but is repackaging/renaming a open source software kosher from a
licensing point of view?
 
 

Matt Higgins wrote:
> 
> I am a bit new to this and I built some class with some simple
> relationships
> based on an existing data base and I am getting the following error.
> 
> org.apache.renamed.openjpa.persistence.PersistenceException: Object id
> data
> "23" loaded from the database for
> "com.smartdestinations.domain.backend.impl.CardImpl.order" is not in the
> correct format. Please ensure that your database records are in the
> correct
> format.
>     at
> org.apache.renamed.openjpa.jdbc.meta.strats.UntypedPCValueHandler.toObjectValue(UntypedPCValueHandler.java:99)
>     at
> org.apache.renamed.openjpa.jdbc.meta.strats.HandlerFieldStrategy.load(HandlerFieldStrategy.java:203)
>     at
> org.apache.renamed.openjpa.jdbc.meta.FieldMapping.load(FieldMapping.java:802)
> 
> 
> 
> My classes look like this
> 
> public class CardImpl extends AbstractSdiEntity implements Card {
> 
>     private String serialNumber;
>     private String type;
>     private Integer days;
>     private Float version;
>     private String status;
>     private SdiOrder order;
> private int id;
> .
> .
> .
> .
> .@ManyToOne(targetEntity = SdiOrder.class)
>     @JoinColumn( name  = "orders_id")
>     public SdiOrder getOrder() {
>         return order;
>     }
> 
> 
> I have no references in the SdiOrder class. The DB tables are in mysql and
> use the following create options
> 
> show create table card
> 
> CREATE TABLE `card` (
>   `id` int(10) NOT NULL auto_increment,
> .
> .
>   `orders_id` int(10) default NULL,
> .
> .
> 
>    PRIMARY KEY  (`id`),
>   UNIQUE KEY `serial_number` (`serial_number`),
>   KEY `orders_id` (`orders_id`),
>   KEY `venue_id` (`venue_id`),
>   KEY `product_id` (`product_id`),
>   KEY `region_id` (`region_id`),
>   KEY `expired_date` (`expired_date`),
>   KEY `status` (`status`),
>   KEY `days` (`days`),
>   KEY `type` (`type`),
>   KEY `days_limit` (`days_limit`)
> 
> 
> If any one could help that would be great. I have trimmed down the class
> and
> db create stuff so the post would not be too long. If you need any more
> info
> please ask.
> 
> -Matt
> 
> 

-- 
View this message in context: http://n2.nabble.com/Strange-error-Please-ensure-that-your-database-records-are-in-the--correct-format-tp2318461p2318935.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.


Re: Strange error Please ensure that your database records are in the correct format

Posted by Matt Higgins <ma...@gmail.com>.
This is a 3rd party app where the jar came from. I did figure out my issue
stupid me, I was using the interface as the targetEntity and not the impl.
Its working now thanks for your help.

On Thu, Feb 12, 2009 at 9:45 PM, Craig L Russell <Cr...@sun.com>wrote:

> Hi Pinaki,
>
> On Feb 12, 2009, at 5:02 PM, Pinaki Poddar wrote:
>
>
>> 1. org.apache.renamed.openjpa.jdbc.meta.strats....
>>
>> Why is the package name different?
>>
>> 2. From the stack trace, the field strategy looks suspicious. It may have
>> been related to the fact that someone renamed/refactored openjpa packages.
>>
>> 3. IANAL, but is repackaging/renaming a open source software kosher from a
>> licensing point of view?
>>
>
> Yes, the Apache license is very liberal, so renaming packages is perfectly
> fine, as long as the conditions of the license are adhered to.
>
> Of course, if the renaming causes problems, it might be very hard to get
> anyone to look at the problem.
>
> Craig
>
>>
>>
>>
> Craig L Russell
> Architect, Sun Java Enterprise System http://db.apache.org/jdo
> 408 276-5638 mailto:Craig.Russell@sun.com
> P.S. A good JDO? O, Gasp!
>
>

Re: Strange error Please ensure that your database records are in the correct format

Posted by Craig L Russell <Cr...@Sun.COM>.
Hi Pinaki,

On Feb 12, 2009, at 5:02 PM, Pinaki Poddar wrote:

>
> 1. org.apache.renamed.openjpa.jdbc.meta.strats....
>
> Why is the package name different?
>
> 2. From the stack trace, the field strategy looks suspicious. It may  
> have
> been related to the fact that someone renamed/refactored openjpa  
> packages.
>
> 3. IANAL, but is repackaging/renaming a open source software kosher  
> from a
> licensing point of view?

Yes, the Apache license is very liberal, so renaming packages is  
perfectly fine, as long as the conditions of the license are adhered to.

Of course, if the renaming causes problems, it might be very hard to  
get anyone to look at the problem.

Craig
>
>

Craig L Russell
Architect, Sun Java Enterprise System http://db.apache.org/jdo
408 276-5638 mailto:Craig.Russell@sun.com
P.S. A good JDO? O, Gasp!