You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by Rick Curtis <cu...@gmail.com> on 2010/01/18 22:01:14 UTC

Mapping an unsupported type

What should happen when a relationship to a non-Entity (or an Entity which
is in a different PU) is found by the OpenJPA runtime? For example, if I had
the following Entity:

@Entity
public class AnnoTest1 {

    @ManyToOne
    Object o;
...
}

This results in a warning message [1], but it is allowed. Does this make
sense, or should we fail fast when this condition is encountered?

[1] 297  TestConv  WARN   [main] openjpa.MetaData - OpenJPA cannot map field
"test.AnnoTest1.o" efficiently.  It is of an unsupported type. The field
value will be serialized to a BLOB by default.

-- 
Thanks,
Rick

Re: Mapping an unsupported type

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

On Jan 18, 2010, at 1:01 PM, Rick Curtis wrote:

> What should happen when a relationship to a non-Entity (or an Entity  
> which
> is in a different PU) is found by the OpenJPA runtime? For example,  
> if I had
> the following Entity:
>
> @Entity
> public class AnnoTest1 {
>
>    @ManyToOne
>    Object o;
> ...
> }
>
> This results in a warning message [1], but it is allowed. Does this  
> make
> sense, or should we fail fast when this condition is encountered?

I think the default (mapping non-persistent types to BLOB) makes sense  
for @Basic types, but I think we should hold relationships to a higher  
standard.

What does @ManyToOne mean when the other side is serialized? No sense  
to me.

Craig
>
> [1] 297  TestConv  WARN   [main] openjpa.MetaData - OpenJPA cannot  
> map field
> "test.AnnoTest1.o" efficiently.  It is of an unsupported type. The  
> field
> value will be serialized to a BLOB by default.
>
> -- 
> Thanks,
> Rick

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!