Return-Path: X-Original-To: apmail-metamodel-dev-archive@minotaur.apache.org Delivered-To: apmail-metamodel-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 98C7BC680 for ; Thu, 18 Jul 2013 17:16:00 +0000 (UTC) Received: (qmail 63502 invoked by uid 500); 18 Jul 2013 17:16:00 -0000 Delivered-To: apmail-metamodel-dev-archive@metamodel.apache.org Received: (qmail 63469 invoked by uid 500); 18 Jul 2013 17:15:59 -0000 Mailing-List: contact dev-help@metamodel.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@metamodel.incubator.apache.org Delivered-To: mailing list dev@metamodel.incubator.apache.org Received: (qmail 63413 invoked by uid 99); 18 Jul 2013 17:15:58 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Jul 2013 17:15:58 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of i.am.kasper.sorensen@gmail.com designates 74.125.82.173 as permitted sender) Received: from [74.125.82.173] (HELO mail-we0-f173.google.com) (74.125.82.173) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Jul 2013 17:15:52 +0000 Received: by mail-we0-f173.google.com with SMTP id x54so3136799wes.4 for ; Thu, 18 Jul 2013 10:15:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=P0Fa49KyN6eTksVRq9cqUvOm/Zc6GaiPJKGCskWQ068=; b=FmvUfeWf+Uwvcpp6S7ndsJPaV4ZGz7GOo1m5Jd+uua8Olf0E+TiDsijsBxZEzfVN8v KB1isoLG88gZwWX2KGX/NCQPbR1o8PErrNZTDtiLu3DUQsEri9EqOiJMy+3NWQqmdEVA 6qICxznQbsozdnq1IyK54zKi4L+/o3HcZOjPncruBHXZG8qeATCenyLS0AJ7Txbf4rUx CuvCcl5G/vJ58PIpEMPQzihLkcg4bpISpG/4dCUdbgLeOsoAc0nmUk/X4tOFkFMms6OA ceZXH3BejZrIiyTwn26pGLVNKgO4oFq+L3LQi7LSah9s7akZLlbhupLlHKaaj/guAaBA wyCg== MIME-Version: 1.0 X-Received: by 10.180.98.231 with SMTP id el7mr19793735wib.33.1374167731977; Thu, 18 Jul 2013 10:15:31 -0700 (PDT) Received: by 10.194.155.65 with HTTP; Thu, 18 Jul 2013 10:15:31 -0700 (PDT) In-Reply-To: <13ff264a706.-7998776108390004590.6531668730229410691@zoho.com> References: <13fefc4c611.2189403079944519319.1253097852409763658@zoho.com> <13ff264a706.-7998776108390004590.6531668730229410691@zoho.com> Date: Thu, 18 Jul 2013 19:15:31 +0200 Message-ID: Subject: Re: how to Query POJO's, multiple tables(or multiple linked objects) From: =?ISO-8859-1?Q?Kasper_S=F8rensen?= To: dev@metamodel.incubator.apache.org Content-Type: multipart/alternative; boundary=f46d04428d2a86c3b904e1cc5bb9 X-Virus-Checked: Checked by ClamAV on apache.org --f46d04428d2a86c3b904e1cc5bb9 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I am glad to help :-) I just meant that everyone is invited to participate, so adressing me will maybe exclude others from answering. Regarding ORM ... The idea has been coming and going from time to time to make an ORM on top of MetaModel. That would allow you to map Java beans to e.g. Access, Excel spreadsheets or whatever. But it seems like something that's worthy of it's own project, except if we limit it to something very basic. 2013/7/18 palmer_one > OK, > Did not know that addressing the specific person was not the way to do > things. > > I just saw the example and it seems to have 2 objects > > "You could make a DataContext with both the 'persons' and 'titles' > collections, and join them, like this:" > > This example is what I am looking for, because I can query some > collections, get the result and then push this result into MS Access as a > table. > > With Jackcess Library it does not allow for creating queries, not yet > anyways. > So one can create a a bunch of tables, but no way to set > relationships/referential integrity and to query > the linked entities. > > I believe the example provided can definitely help. > > When you mentioned ORM, it never occurred to me that maybe one can do thi= s > querying on POJO's using ORM. > And recall that the Jackcess API unfortunately is not a JDBC driver, whic= h > means that direct interaction with ORM and Jackcess is not possible. > > P > > ---- On Thu, 18 Jul 2013 00:40:55 -0700 Kasper S=F8 > rensen<i.am.kasper.sorensen@gmail.com> wrote ---- > Hi Palmer, > > First I should say, please don't address questions like this to me > individually. Although I am one of the lead people here, I am not the onl= y > one and especially with the move to Apache we want to spread knowledge a > lot more. > > I am affraid you're not going to get much luck by using BOTH the access > module and the pojo module. It sounds a bit like you think the pojo modul= e > is a ORM-like mapping module, but actually it is not. It is simply an > in-memory collection based DataContext. It allows querying and updating a= n > in-memory data structure as if it was a database - mostly used for > mocking/testing etc. I just updated the wiki with this example (taken fro= m > the old website): > https://wiki.apache.org/metamodel/examples/PojoDataContext > > So you should stick with the Access module only for your case. And probab= ly > discard the pojos that you mention. > > Does this answer your questions? > > > 2013/7/18 palmer_one <palmer_one@zoho.com> > > > Hi Kasper, I was in contact with you a few years ago. > > I am trying to do things with the Jackcess API, but it does not allo= w > > one to 'push' relationships into a newly created database MDB file. > It only > > allows to put tables and data. > > So I created like 3 tables(POJO's) in memory that represent table > > entities, 2 tables and a join table that handles a Many-to-Many > > relationship or was it a one-to-many relationship. I would like to > query > > this and get a Result-Set back and then push this into Access mdb as= a > > result table. > > SO the context is university courses. One has Faculty table, then th= e > > join table called Sections, and Courses table. > > So if I query a particular professor from Faculty table I want to ge= t > > related data, that is the courses > > he/she teaches. > > How do you use Meta-Model to query multi-tables(POJO objects)? > > Hope you can help. > > Regards, > > P > > > > > > > > > > > --f46d04428d2a86c3b904e1cc5bb9--