Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 66735 invoked from network); 16 Dec 2007 12:40:13 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 16 Dec 2007 12:40:13 -0000 Received: (qmail 47927 invoked by uid 500); 16 Dec 2007 12:40:01 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 47900 invoked by uid 500); 16 Dec 2007 12:40:01 -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 47891 invoked by uid 99); 16 Dec 2007 12:40:01 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 16 Dec 2007 04:40:01 -0800 X-ASF-Spam-Status: No, hits=-99.8 required=10.0 tests=ALL_TRUSTED,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 16 Dec 2007 12:39:39 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 306E2714233 for ; Sun, 16 Dec 2007 04:39:43 -0800 (PST) Message-ID: <25406455.1197808783162.JavaMail.jira@brutus> Date: Sun, 16 Dec 2007 04:39:43 -0800 (PST) From: "Patrick Linskey (JIRA)" To: dev@openjpa.apache.org Subject: [jira] Commented: (OPENJPA-331) Allow BigInteger and other Basic types as Primary Keys In-Reply-To: <2545873.1187903310475.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/OPENJPA-331?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12552194 ] Patrick Linskey commented on OPENJPA-331: ----------------------------------------- Resolved in trunk; keeping open since this probably deserves to be in 1.0.2, but I cannot apply patches to 1.0.2 on this machine due to a lame patch implementation. The new files have a slightly different ASL license banner at the top. To the best of my non-legally-schooled knowledge, it looks right, and I'm reluctant to change someone else's license banner, but it seemed worth highlighting. > Allow BigInteger and other Basic types as Primary Keys > ------------------------------------------------------ > > Key: OPENJPA-331 > URL: https://issues.apache.org/jira/browse/OPENJPA-331 > Project: OpenJPA > Issue Type: Bug > Components: kernel > Affects Versions: 0.9.7, 1.0.0 > Reporter: Kevin Sutter > Assignee: Kevin Sutter > Fix For: 1.0.2, 1.1.0 > > Attachments: fix-OpenJPA-331.patch > > > Section 2.1.4 of the JPA spec outlines the requirements for a primary key (@Id): > Section 2.1.4: A simple ( i.e., non-composite) primary key must correspond to a single persistent field or property of > the entity class. The Id annotation is used to denote a simple primary key. See section 9.1.8. > Also from Section 2.1.4 : The primary key (or field or property of a composite primary key) should be one of the following types: > any Java primitive type; any primitive wrapper type; java.lang.String; java.util.Date; > java.sql.Date. In general, however, approximate numeric types (e.g., floating point types) should > never be used in primary keys. Entities whose primary keys use types other than these will not be portable. > If generated primary keys are used, only integral types will be portable. If java.util.Date is > used as a primary key field or property, the temporal type should be specified as DATE. > Right now, we are treating the "should be" statement above as "must be" and only allowing the specified types as primary keys. But, the sentence in the middle of this paragraph ("Entities whose primary keys use types other than these will not be portable.") indicates that other types can also be allowed, but may not be portable. > It seems that Glassfish allows these additional Basic types as primary keys. We should probably allow the same thing to keep up with the Jones'. > This was discussed on dev mailing list. http://www.nabble.com/BigInteger-as-%40Id-tf4318071.html -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.