Questions Tagged With dataclasshttps://answers.axonivy.com/tags/dataclass/?type=rssquestions tagged <span class="tag">dataclass</span>enWed, 21 Dec 2016 09:19:58 -0500Eager Loadinghttps://answers.axonivy.com/questions/2311/eager-loading<p>Hello Ivy Team,</p> <p>In my project, I had to switch from the default Eager loading to the Lazy loading of the Entity classes. The reason was that the queries were not optimized. Now I have the following problem, every time I try to inspect the variables in debug mode, the Designer is throwing errors and it is almost impossible for debugging:</p> <p><img alt="alt text" src="http://answers.axonivy.com/upfiles/Capture_JJL7IfL.JPG"></p> <p>Best Regards, Yordan Yunchov</p>Stelt0Wed, 21 Dec 2016 09:19:58 -0500https://answers.axonivy.com/questions/2311/eager-loadingprocessdebuggingdesignerjavadataclassEnums in Entity Classeshttps://answers.axonivy.com/questions/1899/enums-in-entity-classes<p>Hi All,</p> <p>What is the best practice in ivy to manage Enums in persistence classes ?</p> <p>this example looks fine to me <a href="http://www.codejava.net/frameworks/hibernate/hibernate-enum-type-mapping-example">http://www.codejava.net/frameworks/hibernate/hibernate-enum-type-mapping-example</a> </p> <p>but how do I implemented in in ivy ? how to add @Enumerated to a field ?</p> <p>Best Regards, Yordan Yunchov</p>Stelt0Mon, 18 Jul 2016 08:58:08 -0400https://answers.axonivy.com/questions/1899/enums-in-entity-classesdataclasshibernateenumEntity Class Migrationshttps://answers.axonivy.com/questions/1872/entity-class-migrations<p>Hello Guys,</p> <p>I`m new to Hibernate and JPA. I have an Axon.Ivy project that has couple of Entity Classes. I want to move them in a separate project and separate namespace(package) and also to add some additional fields.</p> <p>What are the implications when I`m changing the data model and the namespaces ? How do I migrate the changes to the production server ?</p> <p>In .Net Entity Framework there is a concept of 'migrations' where the changes to the database are applied automatically when the code is deploys.</p> <p>Best Regards, Yordan Yunchov</p>Stelt0Wed, 06 Jul 2016 10:08:37 -0400https://answers.axonivy.com/questions/1872/entity-class-migrationsdataclassmigrationpersistenceAvoid MultipleBagFetchException when referencing multiple collections of another typehttps://answers.axonivy.com/questions/1745/avoid-multiplebagfetchexception-when-referencing-multiple-collections-of-another-type<p>I know how to store a single list in a JPA class. but now everytime i try to add another list to any other entity class i get an ivy:error:persistence, with following error message:</p> <pre><code>IvyScriptRuntimeException: IvyScript Runtime Exception in Instruction: ivy.persistence.axsosUnit.findAll(teamprojekt.Job.class) Block: teamprojekt.showDashboard.showDashboardData out; out = in; in.data.closedJobs = ivy.persistence.axsosUnit.findAll(teamprojekt.Job.class); IvyScriptMethodInvocationException: Error calling method findAll(java.lang.Class) on an object of class ch.ivyteam.ivy.process.data.persistence.internal.IvyEntityManager. PersistenceUnitException: Failed to excecute operation "findAll" for persistence unit "axsosUnit". PersistenceUnitException: Could not create EntityManagerFactory of persistence unit'axsosUnit' PersistenceException: [PersistenceUnit: axsosUnit] Unable to build EntityManagerFactory MultipleBagFetchException: cannot simultaneously fetch multiple bags </code></pre> <p>I have read, that you cant use two lists in the same entity class, but i use them in different entity classes. maybe because they are nested?</p> <p>the structure is: institutionList is inside education which is inside application which has the other list.</p> <p>I have also read, the solution is to use a set instead of a list. can you explain how to do this? I've tried to change the list to a set from the entity class wizzard, but without success.</p> <p>can you show me how to do this?</p> <p>thank you very much</p>joha0123Fri, 22 Apr 2016 22:04:56 -0400https://answers.axonivy.com/questions/1745/avoid-multiplebagfetchexception-when-referencing-multiple-collections-of-another-typejpadataclasspersistenceHow can I add a List to a databasehttps://answers.axonivy.com/questions/1740/how-can-i-add-a-list-to-a-database<p>I am filling a List and then I try to write it to the database. We have two Entity Classes: Application and Education. The relationship is 1:N. (One application can have many educations)</p> <p>In the Application entity class I have created a List of Education with the relationship ONE_TO_MANY. Mapped by attribute is <strong>appl</strong>. In the Education entity class i have created a field <strong>appl</strong> with the relationship MANY_TO_ONE.</p> <p>The Problem is, that i have to initialize all objects before i can write data into them. this is impossible to do, because the application Object has a Education object in it and the Education Object has a Application object in it.</p> <p>Is there an other way to save my data to a database?</p> <p>thanks.</p>joha0123Wed, 20 Apr 2016 16:25:00 -0400https://answers.axonivy.com/questions/1740/how-can-i-add-a-list-to-a-databasejpadataclassivypersistenceLink case to datahttps://answers.axonivy.com/questions/1724/link-case-to-data<p>Hi,</p> <p>is it acutally possible to retrive the data of a specific case, to basically show a list of cases with the corresponding dataclasses? Or is there a better way to show a user the state of cases and the data stored within them.</p> <p>So far i tried to solve this via IvyScript and query for the specificy Cases I want to show but I can't find a way to link a case to its input data. </p>poteaSat, 09 Apr 2016 21:07:58 -0400https://answers.axonivy.com/questions/1724/link-case-to-datacasedataclassUse a PrimeFaces with a ivy-date as datatypehttps://answers.axonivy.com/questions/846/use-a-primefaces-with-a-ivy-date-as-datatype<p>Hello everyone, </p> <p>how is it possible to use the primefaces &lt;p:calendar&gt;-element with a "date"-object (ch.ivyteam.ivy.scripting.objects.Date) as destination to save the entered date? In the example on <a href="http://www.xpertivy.ch/releases/Xpert.ivy/5.0.latest/documents/DesignerGuideHtml/ivy.htmldialogs.html#Converters">THIS</a> page (see section "Converters") they used</p> <pre><code>&lt;f:convertDateTime pattern="dd.MM.yyyy" /&gt; </code></pre> <p>this solution worked well on my local Xpert.ivy Designer, but does not on our testserver - it just crashed with an error, that it can't convert a java.util.Date-object into a ch.ivyteam.ivy.scripting.objects.Date-object which is a obviously message, that the "converteDateTime" does not work.</p> <p>In <a href="http://vimeo.com/95734833">THIS</a> video, someone showed that it is definitively possible to save the value of an calendar-component into a ivy-date. Unfortunately i have no possibility to take a look on the automatic generatred code of the Designer.</p> <p>Looking forward for your answers, <br>Nick</p>NickSingerThu, 10 Jul 2014 13:42:10 -0400https://answers.axonivy.com/questions/846/use-a-primefaces-with-a-ivy-date-as-datatypedataclassjsfprimefacesUse java properties in Ivy?https://answers.axonivy.com/questions/476/use-java-properties-in-ivy<p>I want to use properties of a Java class in Ivy. I know that I should use getter and setter methods, but it does not work when I try to call getabc() or setabc(). What is wrong?</p>Bruno BütlerThu, 27 Jun 2013 09:02:56 -0400https://answers.axonivy.com/questions/476/use-java-properties-in-ivydataclassjavaChange data class of a processhttps://answers.axonivy.com/questions/275/change-data-class-of-a-process<p>How can I change the data class of a process after the process is already created?</p>Michael HauckThu, 24 Jul 2008 02:48:33 -0400https://answers.axonivy.com/questions/275/change-data-class-of-a-processprocessdataclass