Is it possible to create an ivy persistence object from String?
Usually a persistence object is created via:
import objects.Product;
// persist new created product
Product product;
product.name = "Product name";
product.nr = 12;
ivy.persistence.<persistence unit>.persist(product);ivy.persistence.webshpo.persist(product);
What we are trying to do (for a dynamic interface) to dynamically create the persistence object with something like:
Object persistenceUnit persistenceObject = Class.forName(in.persistenceUnitName).newInstance();Class.forName(in.persistenceClassName).newInstance();
Is that generally possible? Can that be achieved in a ScriptStep or just in a JavaClass?
Edit:
We tried to give the full package name in the code mentioned above which returns a ClassNotFoundException:
Object persistenceObject = Class.forName("objects.Product").newInstance();
Edit 2:
Changed persistenceUnit = Class.forName("objects.Product").newInstance();naming to persistenceObject according to Daniel's comment.