Return-Path: Delivered-To: apmail-incubator-open-jpa-dev-archive@locus.apache.org Received: (qmail 41701 invoked from network); 10 Apr 2007 21:59:24 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 10 Apr 2007 21:59:24 -0000 Received: (qmail 15202 invoked by uid 500); 10 Apr 2007 21:59:30 -0000 Delivered-To: apmail-incubator-open-jpa-dev-archive@incubator.apache.org Received: (qmail 15178 invoked by uid 500); 10 Apr 2007 21:59:30 -0000 Mailing-List: contact open-jpa-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: open-jpa-dev@incubator.apache.org Delivered-To: mailing list open-jpa-dev@incubator.apache.org Received: (qmail 15169 invoked by uid 99); 10 Apr 2007 21:59:30 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Apr 2007 14:59:30 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of michael.d.dick@gmail.com designates 209.85.132.250 as permitted sender) Received: from [209.85.132.250] (HELO an-out-0708.google.com) (209.85.132.250) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Apr 2007 14:59:22 -0700 Received: by an-out-0708.google.com with SMTP id b2so2235823ana for ; Tue, 10 Apr 2007 14:59:01 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=JvjlW+ErWS13nGPX1HeiliOQNQuq58zkF3sg0tg1iQtBXfyLky9bdgvpaN1IRY/J/HzfauuUQWhnnvCdyftEf6fNvl4UK5HvlZ+gdGOLFUeNiGeld4vxsZrAdpbG9kvvU6gmYBEu9RmicHVvDkuyNZTi92vO8IiUjlDWCG5LqS4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=nscHkscn67Fkle82c02VJMTjpwgm0CfYHkBRSgwnlQTTcKJdgTDfQWoldE0//xIsOuL3W95772i43L+Hj/IqOs1Z+HWMsw3RFtIUlBXLEqjaiQHOCdnhz3yznfsdCWxRe/i1ALlF1Kq0B2HLT2EdX4/hGtUgZytQAqucehwSuSc= Received: by 10.100.133.9 with SMTP id g9mr5303726and.1176242341603; Tue, 10 Apr 2007 14:59:01 -0700 (PDT) Received: by 10.100.6.16 with HTTP; Tue, 10 Apr 2007 14:59:01 -0700 (PDT) Message-ID: <72c1350f0704101459p28a97539tbccb295654a51fc1@mail.gmail.com> Date: Tue, 10 Apr 2007 16:59:01 -0500 From: "Michael Dick" To: open-jpa-dev@incubator.apache.org, jacek@laskowski.net.pl Subject: Re: @Column with precision and scale - how does it work? In-Reply-To: <1b5bfeb50704101332l23478311l1ad3e6c36b89d645@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_38040_27983763.1176242341550" References: <1b5bfeb50704101024v20824132mdf9fccbce8f6b395@mail.gmail.com> <72c1350f0704101301m5a6cf635m9c4d4c57a2b34ecd@mail.gmail.com> <1b5bfeb50704101332l23478311l1ad3e6c36b89d645@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_38040_27983763.1176242341550 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline I'm sorry, I misunderstood your question. I'm afraid I don't know how we determine when to apply the scale and precision. In this case the value should be ignored, since there's no way to set it on the column. If the attribute was of type BigDecimal then I think the precision and scale should apply. The catch here is that it looks like we're mapping BigDecimal to DOUBLE so that won't work. I'll have to take a closer look to determine where that mapping occurs, and what the correct mapping(s) should be. Would you mind opening a JIRA report for the problem? http://issues.apache.org/jira/browse/OPENJPA -Mike On 4/10/07, Jacek Laskowski wrote: > > On 4/10/07, Michael Dick wrote: > > I don't think Derby supports specifying the precision on type DOUBLE > (maybe > > other datbases do). > > You're right - it doesn't. > > > You should be able to specify the precision through the @Column > annotation. > > I believe @Column(columnDefinition="DECIMAL(5,2)") will > > work. > > DECIMAL is a synonim of NUMERIC and either works well. > > > I'm not sure whether precision=x, scale=y with a type that maps to > > DECIMAL instead of DOUBLE. > > That's my question how OpenJPA recognizes whether the attributes > should be used or not. I don't think precision and scale are not used > at all. > > Jacek > > -- > Jacek Laskowski > http://www.JacekLaskowski.pl ------=_Part_38040_27983763.1176242341550--