Usually a persistence object is created via:
What we are trying to do (for a dynamic interface) to dynamically create the persistence object with something like:
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 naming to persistenceObject according to Daniel's comment. asked 25.04.2014 at 10:39 Nikel Weis |
Short answer: Yes. Long answer: You need to create a Java class which returns the persistence object as an object (just ignore the IvyScript-Error):
And then call the class from an ivyScript step:
There are some more pitfalls here but I think this is a very special use case. If someone needs more explanation just comment and I will explain more. answered 05.05.2014 at 08:41 Nikel Weis |
Once you sign in you will be able to subscribe for any updates here
By RSS:Markdown Basics
Tags:
Asked: 25.04.2014 at 10:39
Seen: 4,391 times
Last updated: 05.05.2014 at 08:41
Are you sure you want to switch between persistence units?
Like I have PersistenceUnit (databaseA) and PersistenceUnit(databaseB). Now you want dynamically choose which database to use?
I think I've made a mistake. Im not talking about a persistence unit (on database level) but on data-class level.