I know that could be a stupid question, but I didn’t find nothing about this, to understand how do it and understand if there is a fast mode.
I am writing a function into service bean, it receive an id parameter of column a table, using EntityManager I load an instance of entiy using find method. Now I need to do a clone this entity instance, change few fields on new instance, and insert new row into table database. Column id of table is managed like integer auto incremental.
I know that I can create a new object and then assign all fields variable manually, but I’d like use a dynamic method, without maintenance function copy each time that add a new field.
currently there is no possibility to transparently clone an entity (neither through the UI nor through an API). A similar question is here: Cuba Platform - Copy Action - Stack Overflow
However, it seems to not to be a super big problem (programming wise). But there are some gotchas. One thing is that what happens about soft deleted references or what about a composition to another entity.
So it seems it should be doable of creating such a app component.