Return-Path: Delivered-To: apmail-db-ojb-dev-archive@www.apache.org Received: (qmail 77699 invoked from network); 10 Feb 2006 21:13:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 10 Feb 2006 21:13:52 -0000 Received: (qmail 65054 invoked by uid 500); 10 Feb 2006 21:09:22 -0000 Delivered-To: apmail-db-ojb-dev-archive@db.apache.org Received: (qmail 65014 invoked by uid 500); 10 Feb 2006 21:09:21 -0000 Mailing-List: contact ojb-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "OJB Developers List" Reply-To: "OJB Developers List" Delivered-To: mailing list ojb-dev@db.apache.org Received: (qmail 29943 invoked by uid 99); 10 Feb 2006 20:18:31 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Message-ID: <1773123589.1139602688891.JavaMail.jira@ajax.apache.org> Date: Fri, 10 Feb 2006 21:18:08 +0100 (CET) From: "Jakob Braeuchi (JIRA)" To: ojb-dev@db.apache.org Subject: [jira] Resolved: (OJB-95) Retrieving collections when FK is a VARCHAR In-Reply-To: <1394058226.1139409868872.JavaMail.jira@ajax.apache.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/OJB-95?page=all ] Jakob Braeuchi resolved OJB-95: ------------------------------- Fix Version: 1.1 CVS Resolution: Invalid Relationships based on non primarykey fields are no supported in ojb 1.0.x > Retrieving collections when FK is a VARCHAR > ------------------------------------------- > > Key: OJB-95 > URL: http://issues.apache.org/jira/browse/OJB-95 > Project: OJB > Type: Bug > Components: PB-API > Versions: 1.0.4 > Reporter: Alessandro Vincelli > Fix For: 1.1 CVS > > Hi, > I encountered a weird problem in simply retrieving objects mapped to the following table: > > > > > > > > > > > > > > The problem seems to be with one of the two foreign keys (dbcodass), which is a VARCHAR. > If I fill the dbcodass field with numeric values, everything works fine: I am able to retrieve a collection of Docassiste objects using getCollectionByQuery(). > The problem comes when I really use the dbcodass field as a VARCHAR field. As soon as I populate the table with alphanumeric values, nothing works anymore. getCollectionByQuery throws the following exception: > QUERY BY CRITERIA _______ QueryByCriteria from class w4b.com.cassagest.db.Docassiste where [DBCODASS = PR1] > java.lang.NumberFormatException: For input string: "PR1" > at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48) > at java.lang.Integer.parseInt(Integer.java:468) > at java.math.BigInteger.(BigInteger.java:314) > at java.math.BigInteger.(BigInteger.java:447) > at java.math.BigDecimal.(BigDecimal.java:216) > at org.postgresql.jdbc2.AbstractJdbc2Statement.numericValueOf(AbstractJdbc2Statement.java:1477) > at org.postgresql.jdbc2.AbstractJdbc2Statement.setObject(AbstractJdbc2Statement.java:1520) > at > (full stacktrace below) > NOTE: If I remove form : > > > > and this lines from NOTE: If I remove form :: > > > > The method getCollectionByQuery() work fine!! > Any ideas? > Alessandro > COMPLETE REPOSITORY: > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org For additional commands, e-mail: ojb-dev-help@db.apache.org