Return-Path: Delivered-To: apmail-cayenne-user-archive@www.apache.org Received: (qmail 12545 invoked from network); 27 Jul 2009 16:54:32 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 27 Jul 2009 16:54:32 -0000 Received: (qmail 67802 invoked by uid 500); 27 Jul 2009 16:55:36 -0000 Delivered-To: apmail-cayenne-user-archive@cayenne.apache.org Received: (qmail 67783 invoked by uid 500); 27 Jul 2009 16:55:36 -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 67764 invoked by uid 99); 27 Jul 2009 16:55:36 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Jul 2009 16:55:36 +0000 X-ASF-Spam-Status: No, hits=-1.0 required=10.0 tests=RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of gcjcu-cayenne-user-moved1@m.gmane.org designates 80.91.229.2 as permitted sender) Received: from [80.91.229.2] (HELO ciao.gmane.org) (80.91.229.2) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Jul 2009 16:55:24 +0000 Received: from root by ciao.gmane.org with local (Exim 4.43) id 1MVTTa-0003xs-Vw for user@cayenne.apache.org; Mon, 27 Jul 2009 16:55:02 +0000 Received: from cust.static.84-253-63-109.cybernet.ch ([84.253.63.109]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 27 Jul 2009 16:55:02 +0000 Received: from andreas by cust.static.84-253-63-109.cybernet.ch with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 27 Jul 2009 16:55:02 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: user@cayenne.apache.org From: Andreas Hartmann Subject: Re: PostgreSQL schemas for multi-tenant application Date: Mon, 27 Jul 2009 18:50:26 +0200 Lines: 70 Message-ID: References: <5adb61290907270852n19db3666odf2da6b1a048bf1d@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: cust.static.84-253-63-109.cybernet.ch User-Agent: Thunderbird 2.0.0.22 (Macintosh/20090605) In-Reply-To: <5adb61290907270852n19db3666odf2da6b1a048bf1d@mail.gmail.com> Sender: news X-Virus-Checked: Checked by ClamAV on apache.org Hi Michael, Michael Gentry schrieb: > I think multiple DataDomains might be what you want, but I'm not 100% > certain everything you are trying to do. > Also, if you are just starting out, it might be worthwhile to use Cayenne > 3.0M6. thanks for your reply! Do you think a final release of Cayenne 3.0 will be available this year? Our application shall go live in January, and since I'm not familiar with the Cayenne project yet I'm not sure whether the milestones should be used in production. -- Andreas > > mrg > > > On Sun, Jul 26, 2009 at 10:51 AM, Andreas Hartmann wrote: > >> Andreas Hartmann schrieb: >> >>> Andreas Hartmann schrieb: >>> >>>> Hi Cayenne users & devs, >>>> >>>> I'm currently designing the DB + ORM layer for a multi-tenant >>>> application, using PostgreSQL 8.3 and Cayenne 2.0.4. >>>> >>>> After some research it looks like PostgreSQL schemas are a pretty decent >>>> way to achieve the separation of the tenant data on the DB level. >>>> Unfortunately, it looks like multiple schemas are not supported by Cayenne. >>>> >>> I just noticed that the DbEntity class has a schema property. Would the >>> following approach work? >>> >>> Create a DB entity for each table in each schema, e.g. users_schema1, >>> users_schema2 etc. >>> >>> To run a query: >>> >>> DbEntity entity = dataMap.getDbEntity("users_" + schemaName); >>> SelectQuery query = new SelectQuery(entity, expression); >>> >> It seems like this won't work because for each DB entity an object entity >> (i.e. class) would be required. >> >> But I found the section on multiple DataDomains in the documentation. I >> guess this is the way to go? >> >> >> -- Andreas >> >> >> -- >> Andreas Hartmann, CTO >> BeCompany GmbH >> http://www.becompany.ch >> Tel.: +41 (0) 43 818 57 01 >> >> > -- Andreas Hartmann, CTO BeCompany GmbH http://www.becompany.ch Tel.: +41 (0) 43 818 57 01