Return-Path: X-Original-To: apmail-openjpa-dev-archive@www.apache.org Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D6560444F for ; Wed, 29 Jun 2011 18:42:10 +0000 (UTC) Received: (qmail 34567 invoked by uid 500); 29 Jun 2011 18:42:10 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 34535 invoked by uid 500); 29 Jun 2011 18:42:10 -0000 Mailing-List: contact dev-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openjpa.apache.org Delivered-To: mailing list dev@openjpa.apache.org Received: (qmail 34527 invoked by uid 99); 29 Jun 2011 18:42:09 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Jun 2011 18:42:09 +0000 X-ASF-Spam-Status: No, hits=2.0 required=5.0 tests=SPF_NEUTRAL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [216.139.236.26] (HELO sam.nabble.com) (216.139.236.26) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Jun 2011 18:42:03 +0000 Received: from jim.nabble.com ([192.168.236.80]) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1Qbzhm-0001pj-7m for dev@openjpa.apache.org; Wed, 29 Jun 2011 11:41:42 -0700 Date: Wed, 29 Jun 2011 11:41:42 -0700 (PDT) From: Pinaki Poddar To: dev@openjpa.apache.org Message-ID: <1309372902232-6530220.post@n2.nabble.com> In-Reply-To: References: <1309363133197-6529561.post@n2.nabble.com> Subject: Re: Metamodel generates ListAttribute for arrays instead of SingularAttribute MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Arrays are specialized Lists. Or Lists are specialized Arrays. Like Rectangle is a specialized Square. Or Square is a specialized Rectangle. Formal language inheritance concept does not pin this either way but allows one to consider either view. OpenJPA had so far modeled Array as second-class container in a consistent manner as it did for java.util.Collection and its subtypes. I support such modeling. It also has an extra makeDirty() because of technical complexity of tracking changes in second-class containers w.r.t Arrays. >From that viewpoint of maintaining continuity of design principles of the original authors, the modeling of Array as List is correct, imo. Primitive collection requires different treatment. That is why JPA 2.0 had to annotate @ElementCollection to distinguish from reference collection. Let us keep that aside for the time being. Now on why "X spec says so..." is a weak argument Specs are combined voices of you and I and all the people who are brave and crazy enough to explore new ideas in open source projects. Specs follow Open Source. Not the other way around. Open Source is the playground where technical debate (as we are now engaged in) takes place, where new ideas emerge. If the ideas are solid and the democracy of users accept it -- then the spec of future years will adopt it. As far as persistence of Arrays is concerned -- JPA spec says almost nothing. The onus is on us as open source developers who have to figure out what is a *good* way. If the users accept it -- then we did a good job and we can take our view to the experts of spec committee to make that view part of a standard. Today where JPA spec stands is a testimonial to such effort by Hibernate or Kodo and many others who built their software *without* a spec guiding them what to do or what is the "right" way. In fact, it is they who made today's JPA spec possible. That is why I said : "X spec says so..." is a weak argument in a open source context. ----- Pinaki -- View this message in context: http://openjpa.208410.n2.nabble.com/Metamodel-generates-ListAttribute-for-arrays-instead-of-SingularAttribute-tp6529049p6530220.html Sent from the OpenJPA Developers mailing list archive at Nabble.com.