Return-Path: Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: (qmail 67153 invoked from network); 7 Nov 2005 22:28:26 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 7 Nov 2005 22:28:26 -0000 Received: (qmail 91281 invoked by uid 500); 7 Nov 2005 22:28:18 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 91248 invoked by uid 500); 7 Nov 2005 22:28:18 -0000 Mailing-List: contact derby-user-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Reply-To: "Derby Discussion" Delivered-To: mailing list derby-user@db.apache.org Delivered-To: moderator for derby-user@db.apache.org Received: (qmail 78094 invoked by uid 99); 7 Nov 2005 22:16:17 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Mime-Version: 1.0 (Apple Message framework v746.2) Content-Transfer-Encoding: 7bit Message-Id: <01A45A26-4599-4666-948A-328C3453FBED@mbari.org> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed To: user@castor.codehaus.org, derby-user@db.apache.org From: Brian Schlining Subject: [JDO] bit/boolean in apache derby Date: Mon, 7 Nov 2005 14:17:14 -0800 X-Mailer: Apple Mail (2.746.2) X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hi All, I'm porting an application from SQL Server to Apache Derby. The application uses a table that contains a bit column to store a boolean type value (0 = false, 1 = true). I've looked through the Derby documentation available at http://db.apache.org/derby/docs/10.1/ ref/ and there's not a bit data type in Derby. Any recommendations on what I should be using in Derby to map bit values? A little more background: My application uses an O/R mapping layer (Castor, http:// www.castor.org) and is meant to be portable across databases, (i.e it should run on SQL Server, Derby and others without having to modify code or mapping files.). The application is also being used in a production environment so changing the bit field on SQL server to something else isn't really a good option for me. The offending tables T-SQL is: CREATE TABLE [dbo].[Media] ( [id] bigint NOT NULL, [ConceptDelegateID_FK] bigint NULL, [MediaFileName] varchar(1024) NULL, [MediaType] char(5) NULL, [PrimaryMedia] bit NULL DEFAULT (0), [Credit] varchar(255) NULL, [Caption] varchar(1000) NULL, CONSTRAINT [PK_Media] PRIMARY KEY([id]) ) GO BTW, the application in question can be found at http:// vars.sourceforge.net Cheers B ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining MBARI Software Engineer brian@mbari.org (831)775-1855 http://www.mbari.org/staff/brian