Return-Path: Delivered-To: apmail-cayenne-user-archive@www.apache.org Received: (qmail 59139 invoked from network); 14 Jan 2009 13:47:19 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 14 Jan 2009 13:47:19 -0000 Received: (qmail 92686 invoked by uid 500); 14 Jan 2009 13:47:18 -0000 Delivered-To: apmail-cayenne-user-archive@cayenne.apache.org Received: (qmail 92660 invoked by uid 500); 14 Jan 2009 13:47:18 -0000 Mailing-List: contact user-help@cayenne.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cayenne.apache.org Delivered-To: mailing list user@cayenne.apache.org Received: (qmail 92649 invoked by uid 99); 14 Jan 2009 13:47:18 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Jan 2009 05:47:18 -0800 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of mr.abanjo@gmail.com designates 209.85.219.32 as permitted sender) Received: from [209.85.219.32] (HELO mail-ew0-f32.google.com) (209.85.219.32) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Jan 2009 13:47:10 +0000 Received: by ewy13 with SMTP id 13so175502ewy.4 for ; Wed, 14 Jan 2009 05:46:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:mime-version:content-type; bh=pt4W31Ce2itbttkd0VzUOAoxce6VjrzyF02Unjr6Gh8=; b=RHYhuRIg03F5q57hLmqYR0lSYjrT3C2T8SzZffe2Ju6LyTYu60d8mWP1nCv7zom+dN 8OVrdXE0FZzCttV3GHPqIm2UT0QbFvCUaY2lICZsOO6GKl5ieTaKeaBfMe5IoQHm3TPE OsPKv1EGWC1989YtDgOsgPH0gd4HE+foCM/h4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type; b=cO/bi0NwuP5r9visQ8NU0kdDgvbEWbhbWAnfXiiY0hvY+qMQ+KXpCmR8IvqCoMYLdD uvJcKMMQfsL6s8s45C0hOhpXsZ1jaZBMUgiXT51YXCzW0nNM//dQS5UsoCkP2kCJA8Ij hBr45QoluSVMTwCqwd8Z+y/pdecbA7qh4+/sM= Received: by 10.210.89.4 with SMTP id m4mr152530ebb.27.1231940810015; Wed, 14 Jan 2009 05:46:50 -0800 (PST) Received: by 10.210.56.13 with HTTP; Wed, 14 Jan 2009 05:46:49 -0800 (PST) Message-ID: <90cd2d0901140546p6c6fa14di6c9cbd7840da95f4@mail.gmail.com> Date: Wed, 14 Jan 2009 14:46:49 +0100 From: mr.abanjo To: user@cayenne.apache.org Subject: DB Generation MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_346625_1687280.1231940810002" X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_346625_1687280.1231940810002 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi,i have configured a simple cayenne datamap for my application with 2 table. All works fine, i can read/write into them without problem. Now, i want to create at runtime the database schema, so if is the first time and the database is empty i can generate it on the fly. I do it with this code (taken from petstore sample in cayenne's wiki): DataDomain domain = Configuration.getSharedConfiguration().getDomain(); DataNode node = getDataNode(domain); DbGenerator generator = new DbGenerator(node.getAdapter(), getDataMap(domain)); try { generator.runGenerator(node.getDataSource()); } catch (Exception e) { throw new Exception("Error generating DB schema", e); } If i test this code on a HSQLDB it works well. The strange thing is that after execution i have 3 tables instead of 2... infact there is also "AUTO_PK_SUPPORT" that i haven't defined in my datamap. I suppose that it is a table used by canyenne. But if i test it on MYSQL db it doesn't work. ONLY the "AUTO_PK_SUPPORT" is created. Anyone have idea why the same code works in 2 different way? The user that i use to connect to mysql haves all privileges. Thanks Davide ------=_Part_346625_1687280.1231940810002--