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 81AF8200BBA for ; Sat, 22 Oct 2016 05:14:37 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 802C9160AE9; Sat, 22 Oct 2016 03:14:37 +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 C4287160AE8 for ; Sat, 22 Oct 2016 05:14:36 +0200 (CEST) Received: (qmail 5117 invoked by uid 500); 22 Oct 2016 03:14:36 -0000 Mailing-List: contact dev-help@zest.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@zest.apache.org Delivered-To: mailing list dev@zest.apache.org Received: (qmail 5069 invoked by uid 99); 22 Oct 2016 03:14:28 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 22 Oct 2016 03:14:28 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id CDAF01A0287 for ; Sat, 22 Oct 2016 03:14:27 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.78 X-Spam-Level: * X-Spam-Status: No, score=1.78 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.001, HTML_MESSAGE=2, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd2-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 (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id X7PHPzw9k2zZ for ; Sat, 22 Oct 2016 03:14:25 +0000 (UTC) Received: from mail-it0-f53.google.com (mail-it0-f53.google.com [209.85.214.53]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 171FB5F201 for ; Sat, 22 Oct 2016 03:14:25 +0000 (UTC) Received: by mail-it0-f53.google.com with SMTP id 198so4797197itw.0 for ; Fri, 21 Oct 2016 20:14:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to; bh=K041j+ISwejCOKhyOp5mHHZJZ+yKAoJSf+4zL8xFJkQ=; b=nMFfJDPHYcUFID2EI9VuOfFQyZdvLXdohGJBvF4HzUGHZXqL6JqYJlwVmyXd0Vmc+Q MkN9kOXgMbj10+5ev2YEHcfh+HQsS2DTw3Z2XEP7mRnHfx79Td56v86oNSOF/7FTcsOU RNXesnzwpRy95mjVk3f01ZkACeGczn0bqiJM7fki+hCCAIAhiLCglXJLrYrxjzi4mTmB 3OZ+S58PkjZ5LxIqEZjdQMt86Mne3HYH0mh9Sq1n9h1HyNftZe+isKAbpwoxzuABl2XJ 4rpsxtb7XW8/UJZcAkGFOrf8Xt/3UysE99VHVmF9AHH+a2tCa7Qru53bNSDYvghEjn5z m7dw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to; bh=K041j+ISwejCOKhyOp5mHHZJZ+yKAoJSf+4zL8xFJkQ=; b=RpJV0QodCh7CYFxonH/p+1HdqkpJhSKAJw4pxzrKOpyU/q1GndL7Z80N7DY7pAn0Ti Efjhjm1A/8V5Xn5ZcC/eNI2s4MpYNNnmAJ8dKWBuydQ49s+5OyJYfYuuNc0zHI5Ejr2T aZZlJGXBM7ghbdjw8nx+TMlCUxje3ZXJYooYV6GvSHwDZ86htVrPcHo+YZZmkUKnKK44 zDmPqOkpIEJC9rT5CAp954oMcSYWPwWmh0t90p+1CA64mc0W2UC2iYQfguz0MCLxEsZS FN6vOrkTRffP/WJcPtHS4FJtnAomvznl9kc6wNKYmYne4jUXK9fdXkNODpTmxnPnBGJ7 t2aw== X-Gm-Message-State: AA6/9RnW+5MtVpVN43CFs2To2G7LkY847NpVwBXR5ZpdqsbYW5U/HLy+fB1rMYKD6sqG+QxB6eOMLrWafmUWAA== X-Received: by 10.202.78.205 with SMTP id c196mr13104878oib.158.1477106063433; Fri, 21 Oct 2016 20:14:23 -0700 (PDT) MIME-Version: 1.0 Sender: hedhman@gmail.com Received: by 10.202.170.78 with HTTP; Fri, 21 Oct 2016 20:14:03 -0700 (PDT) In-Reply-To: References: From: Niclas Hedhman Date: Sat, 22 Oct 2016 11:14:03 +0800 X-Google-Sender-Auth: HmjY5PaxLMkHFjOjKhNZJszg5C0 Message-ID: Subject: Re: Listing composite properties To: dev Content-Type: multipart/alternative; boundary=001a11c16b1834e401053f6b8eab archived-at: Sat, 22 Oct 2016 03:14:37 -0000 --001a11c16b1834e401053f6b8eab Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Quite right. The idea with SPI is roughly; If you don't create Extensions (or advanced libraries), then you should normally not depend on the core.spi module at all, to ensure that you are not in too deep. Yes, the Qi4j -> ZestAPI and Qi4jSPI -> ZestSPI. One other major issue is that Iterables are being replaced with Java 8 Stream API just about everywhere. Cheers Niclas On Sat, Oct 22, 2016 at 10:28 AM, zhuangmz08 wrote: > Thanks all. > I'm using "org.qi4j.core:org.qi4j.core.api:2.1". Then, I need to replace > org.apache.zest.api.ZestAPI with org.qi4j.api.Qi4j, replace > org.apache.zest.spi.ZestSPI with org.qi4j.spi.Qi4jSPI. I've get my > PropertyDescriptors. > SPI extends from API. And SPI is designed for building extensions. Thus, > I'd better use SPI rather than API. > Is my understanding right? > > > > > > > ------------------ =E5=8E=9F=E5=A7=8B=E9=82=AE=E4=BB=B6 -----------------= - > =E5=8F=91=E4=BB=B6=E4=BA=BA: "Niclas Hedhman";; > =E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: 2016=E5=B9=B410=E6=9C=8822=E6=97=A5= (=E6=98=9F=E6=9C=9F=E5=85=AD) =E4=B8=8A=E5=8D=888:11 > =E6=94=B6=E4=BB=B6=E4=BA=BA: "dev"; > > =E4=B8=BB=E9=A2=98: Re: Listing composite properties > > > > Note that the EntityDescriptor (and its siblings) extends > StatefulCompositeDescriptor, which allows you to obtain the > StateDescriptor/ > AssociationStateDescriptor where you can get the PropertyDescriptors and > AssociationDescriptors, which is what you were asking for. If you have th= e > Property, you can get the PropertyDescriptor directly from the ZestAPI, > without trying to locate it inside the CompositeDescriptors. > > > There are a whole set of good methods in the ZestAPI class for regular > code. There are additional methods available in ZestSPI, more suitable fo= r > use when you are creating Extensions and very generic libraries. > > HTH > > On Sat, Oct 22, 2016 at 1:06 AM, Paul Merlin wrote: > > > Hi, > > > > zhuangmz08 a =C3=A9crit : > > > Hi, I'm trying to persist my Value/Entity Composite into database. Ca= n > I > > list all the properties (name, type) of the composite? Thanks. > > > > Yes! You need to get hold of your Value/Entity descriptors. > > This can be done through the ZestAPI, e.g.: > > > > @Structure ZestAPI api; > > > > void someMethod() > > { > > EntityDescriptor descriptor =3D api.entityDescriptorFor( someEntity= ); > > } > > > > HTH > > > > > > > -- > Niclas Hedhman, Software Developer > http://zest.apache.org - New Energy for Java > --=20 Niclas Hedhman, Software Developer http://zest.apache.org - New Energy for Java --001a11c16b1834e401053f6b8eab--