polygene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Niclas Hedhman <nic...@hedhman.org>
Subject Re: Listing composite properties
Date Sat, 22 Oct 2016 00:11:04 GMT
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 the
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 for
use when you are creating Extensions and very generic libraries.


On Sat, Oct 22, 2016 at 1:06 AM, Paul Merlin <paul@nosphere.org> wrote:

> Hi,
> zhuangmz08 a écrit :
> > Hi, I'm trying to persist my Value/Entity Composite into database. Can 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 = api.entityDescriptorFor( someEntity );
> }

Niclas Hedhman, Software Developer
http://zest.apache.org - New Energy for Java

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message