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. HTH On Sat, Oct 22, 2016 at 1:06 AM, Paul Merlin <[email protected]> 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 ); > } > > HTH > > -- Niclas Hedhman, Software Developer http://zest.apache.org - New Energy for Java
