Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Add a new persistent object (class-descriptor) at runtime?

object persistent runtime
0
Posted

Add a new persistent object (class-descriptor) at runtime?

0

You could add class-descriptors at runtime, using the MetadataManager : DescriptorRepository dr = MetadataManager. getInstance().getRepository(); ClassDescriptor cld = new ClassDescriptor(dr); cld.setClassOfObject(A.class); //…. other setter // add the fields of the class FieldDescriptor fd = new FieldDescriptor(cld, 1); fd.setPersistentField(A.class, “someAField”); cld.addFieldDescriptor(fd); // now we add the the class descriptor dr.setClassDescriptor(cld); Please see section Metadata Handling in system documentation for further information.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123