Return-Path: X-Original-To: apmail-cayenne-commits-archive@www.apache.org Delivered-To: apmail-cayenne-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0894910B11 for ; Tue, 10 Feb 2015 18:14:15 +0000 (UTC) Received: (qmail 54986 invoked by uid 500); 10 Feb 2015 18:14:12 -0000 Delivered-To: apmail-cayenne-commits-archive@cayenne.apache.org Received: (qmail 54967 invoked by uid 500); 10 Feb 2015 18:14:12 -0000 Mailing-List: contact commits-help@cayenne.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cayenne.apache.org Delivered-To: mailing list commits@cayenne.apache.org Received: (qmail 54957 invoked by uid 99); 10 Feb 2015 18:14:11 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Feb 2015 18:14:11 +0000 Date: Tue, 10 Feb 2015 18:14:11 +0000 (UTC) From: "John Huss (JIRA)" To: commits@cayenne.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (CAY-1987) Widen types before performing in-memory evaluation of qualifiers using j.l.Number subclasses MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CAY-1987?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] John Huss updated CAY-1987: --------------------------- Attachment: 0001-CAY-1987-Widen-types-before-performing-in-memory-eva.patch Patch attached with unit tests > Widen types before performing in-memory evaluation of qualifiers using j.l.Number subclasses > -------------------------------------------------------------------------------------------- > > Key: CAY-1987 > URL: https://issues.apache.org/jira/browse/CAY-1987 > Project: Cayenne > Issue Type: Improvement > Components: Core Library > Affects Versions: 4.0.M2 > Environment: trunk > Reporter: John Huss > Priority: Minor > Attachments: 0001-CAY-1987-Widen-types-before-performing-in-memory-eva.patch > > > There is a difference in the behavior of Expressions evaluated in memory versus by the database when comparing attributes with a type like java.lang.Short with a literal of type java.lang.Integer. In memory Short(1) != Integer(1), but they are equal in the database. Using a less strict comparison in memory would be preferable. > I figured there would be an open source implementation of this somewhere that calculates the widest type and compares the two values, but I couldn't find one. I imagine you could just call number.doubleValue() and compare that, but that seems sketchy. > If you think this is worth doing I could try writing an implementation. -- This message was sent by Atlassian JIRA (v6.3.4#6332)