openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pinaki Poddar <ppod...@apache.org>
Subject Re: Metamodel generates ListAttribute for arrays instead of SingularAttribute
Date Wed, 06 Jul 2011 14:48:26 GMT
Kevin,

  Always good of you to provide a context for a topic.

  The spec defines 'collection-valued attribute' with lot of words
essentially meaning anything that implements java.util.Collection (or
java.util.Map). But the problem with such definition based on syntax (i.e.
it implements so-and-so interface) versus on semantic (i.e. a collection is
container of elements) can come to light in the following if we adhere to
closely:
@Entity
public class Bar {}

@Entity
public class Foo {
   private Bar[]       a;
   private List<Bar> b;
}

would make attribute a and b treated quite differently. 

That arrays and list are semantically similar shows up in Java language via
Arrays.asList() or List.toArray() methods -- List and Array are fungible. It
is JPA, that does not recognize that fact well. 

What does Dali do for an attribute like 'a' as in above example?

 

-----
Pinaki 
--
View this message in context: http://openjpa.208410.n2.nabble.com/Metamodel-generates-ListAttribute-for-arrays-instead-of-SingularAttribute-tp6529049p6554648.html
Sent from the OpenJPA Developers mailing list archive at Nabble.com.

Mime
View raw message