Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 125A7200CE5 for ; Sun, 23 Jul 2017 04:59:58 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 05CB31646DE; Sun, 23 Jul 2017 02:59:58 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 234001646DD for ; Sun, 23 Jul 2017 04:59:56 +0200 (CEST) Received: (qmail 80124 invoked by uid 500); 23 Jul 2017 02:59:56 -0000 Mailing-List: contact dev-help@polygene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@polygene.apache.org Delivered-To: mailing list dev@polygene.apache.org Received: (qmail 80111 invoked by uid 99); 23 Jul 2017 02:59:55 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 23 Jul 2017 02:59:55 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 413BFC0CB0 for ; Sun, 23 Jul 2017 02:59:55 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.002 X-Spam-Level: ** X-Spam-Status: No, score=2.002 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.001, HTML_MESSAGE=2, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id BJMAHpPaa0rK for ; Sun, 23 Jul 2017 02:59:42 +0000 (UTC) Received: from mail-lf0-f46.google.com (mail-lf0-f46.google.com [209.85.215.46]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 120CF5F3BF for ; Sun, 23 Jul 2017 02:59:42 +0000 (UTC) Received: by mail-lf0-f46.google.com with SMTP id y15so34125320lfd.5 for ; Sat, 22 Jul 2017 19:59:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to; bh=0M2Tw+U8iMt4PJ5ZnhNNnejCA42ugb7zk9MF9AwIhD0=; b=Sj4M9EdxdkppbV7MiiherzRZCQ+gmQQrWUaZDJm7Jc8ZID1bfWrGNNCOwHbVg4EzRu Ly/Ctqo+82b8OTzj6iHYPWLHpB1pZbr3rpVFMVZjlfPgmSCFzA28seu6ZzZ4LrOPh03t ICRzsywEvSgvX91pzChmzRAvzcQ4sE964pSknPxZ1OeGLiMFYRDf1ab/c18ft1LSvMk8 FK2c30BGPrF1KiDt9mNIPlV+32kGRCMDSvP5OXC+y6PeyNerCBNEQ92qgRgEIWBNQIMQ Sytz5jsBbozAh9tZ/kReLODuRaF79UyheiP0hRjk5L55pgYElyoGegp8h+vTveKCxmLN BQoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to; bh=0M2Tw+U8iMt4PJ5ZnhNNnejCA42ugb7zk9MF9AwIhD0=; b=YxVX+jtEHrZV9jVLxlwhdPyg/ww/dvdW9iefKNOPPHE3QAo66nIMGJuNOOSyRVbYlD BNVX1pLTYc2VkeHNEAOrojXeOlHiULeSePhxMI2bYuj3qRK2trRMzrpvoZKVpj+ETDAK nwBcMR59DdLjPlX4bHQpDvbDPbaaj1JLfZrCC3kYD5cDvOYff6XOMHSkZBUFOuYS3F+t VAjolkNHAnGcGMF+Um1w3N/fV6xpd+hfiubtDRD7KbGDkOS4sMBwZ+9TqqANv7I405aQ AuPvweonxP3GJklSOvW7j6mER2YEYRpY0HtJ/JhB9Avxh01FNEZwTzXWd9HZmOgdUJvi wkpA== X-Gm-Message-State: AIVw110mvCqixJpod5VORk0LSHoCxF9dbJxiSeOJFo/HCckqicxOYgzz dFX0lX2ft1u11jPTRGvIFwgJfeaFwEAB X-Received: by 10.46.97.1 with SMTP id v1mr380456ljb.182.1500778780635; Sat, 22 Jul 2017 19:59:40 -0700 (PDT) MIME-Version: 1.0 Sender: hedhman@gmail.com Received: by 10.46.14.17 with HTTP; Sat, 22 Jul 2017 19:59:20 -0700 (PDT) In-Reply-To: References: From: Niclas Hedhman Date: Sun, 23 Jul 2017 10:59:20 +0800 X-Google-Sender-Auth: DutXtuAxtVRrkXUU64Q6RcZOj3E Message-ID: Subject: Re: ORM EntityStore To: dev@polygene.apache.org Content-Type: multipart/alternative; boundary="f403045f72341b38600554f34ac3" archived-at: Sun, 23 Jul 2017 02:59:58 -0000 --f403045f72341b38600554f34ac3 Content-Type: text/plain; charset="UTF-8" I assume that you are referring to (from sample project) public static Person findPersonNamed(String firstName, String lastName) { Operation findByFirstNameAndLastName = PersonFinder.firstName().eq(firstName) .and(PersonFinder.lastName().eq(lastName)); return PersonFinder.findOne(findByFirstNameAndLastName); } which on paper is somewhat similar. However, there seems to be rather large hurdles; 1. They start with an app model in XML 2. They generate source code from that XML in build time, and quite a bit of it [1]. 3. The PersonFinder has "Polygene naming", and it is a class that is regenerated on every build. 4. Person is a one-time generated class, extending a every time generated AbstractPerson that follows "getter/setter naming". 5. Static methods... why? 6. It seems that transactions are wrapped in a single method, and that doesn't fit the UnitOfWork workflow [2] 7. A lot of the generated stuff is about providing a query interface. The codebase is non-trivial, I give them that. And it might be a lot better than JPA, I mean it is hard not to be worse. Now, using it out of the box is probably impossible, and I don't think it is possible to make this generic enough to be able to leverage Polygene models, so the alternative would be to fork it and massage it into what we would need. More effort than _I_ care to go for... HTH Niclas [1] https://goldmansachs.github.io/reladomo-kata/main-kata-presentation/ReladomoKata.xhtml#(11) https://goldmansachs.github.io/reladomo-kata/main-kata-presentation/ReladomoKata.xhtml#(12) [2] https://goldmansachs.github.io/reladomo-kata/main-kata-presentation/ReladomoKata.xhtml#(65) On Sat, Jul 22, 2017 at 4:31 PM, Jiri Jetmar wrote: > Hi guys, > > there is an interesting project open sourced by Goldman Sachs: > > https://github.com/goldmansachs/reladomo > > It is a basically a Java ORM with some pretty unique features and the Query > DSL is in some ways similar to what we are using in Apache Polygene : > > Person.createPerson("Taro", "Tanaka", "JPN"); > Person person = Person.findPersonNamed("Taro", "Tanaka"); > > Evtl. this can be used as ORM in Apache Polygene ? Looks promising, so lets > see.. > > Cheers, > Jiri > > > > 2017-05-06 10:25 GMT+02:00 Niclas Hedhman : > > > Gang, > > > > I have gotten overly angry with Hibernate on $dayjob, and decided to > take a > > look at what a ORM-ish implementation in Polygene would look like. And it > > was easier than I expected, so... > > > > Pretty simple, > > > > 0. One "types table" that keep tracks of all types. Content of this is > > probably fully cached. > > > > 1. One type table for each MixinType (except HasIdentity) > > > > 2. One "base entity" table with the Identity, lastmodifed and so on > stuff. > > > > 3. Use a different (internal) identity for the "value", which makes it > easy > > to fully support non-destructive updates. > > > > 4. Property->SQL on basic types, and Serialization kick in on > > ValueComposites. > > > > 5. Association->SQL is simply a VARCHAR > > > > 6. Named/ManyAssociation->SQL needs an intermediate table per assoc > (naming > > is trouble some) > > > > 7. get() becomes a SELECT with one join per mixin type > > > > 8. new/update is bunch of INSERT (if non-destructive is used) SQL > > statement, one for each mixin type plus an UPDATE for "base entity". > > > > 9. Named/ManyAssociations will also be an INSERT with many values. > > > > 10. JOOQ is awfully helpful in making this, and I am trying to modularize > > it so that people can customize it if needed, at Composite Methods level, > > either by Concerns or overriding Mixin methods. > > > > 11. IF destructive mode is wanted, I suggest that DELETE statements are > > issued to remove old stuff, which makes both modes semantically > identical, > > and not a big deal if something is accidentally not removed. > > > > And that is pretty much it. Fairly straight forward, and a far cry from > the > > complexity of Hibernate, guessing what it does and why. > > > > NOTE, this is only for "Java Model drives SQL model", but in an > > enterprise-friendly way. I hope that this can be a big "adoption driver". > > > > WDYAT? > > > > > > Cheers > > -- > > Niclas Hedhman, Software Developer > > http://polygene.apache.org - New Energy for Java > > > -- Niclas Hedhman, Software Developer http://polygene.apache.org - New Energy for Java --f403045f72341b38600554f34ac3--