posted 6 years ago
Hi Rob,
Thanks for the response. Please let me elaborate my problem and what I'm trying to achieve.
I'm taking a generic approach in insert and update operations. The data that i'm saving in db is coming from some JSON and I can retrieve the Entity class name from URL. I'm creating an object from JSON. In different scenarios object will be of different entity classes and I'm also able to cast them to the respective entity using reflection.
I could have used update query but the incoming data might contain some OneToMany relationships, so I've stick with merge() so that in single call the whole data can be saved. Due to generic approach my update logic cannot contain any code that sets the fields of a particular class. Is there any way to achieve this staying with my current approach.
Thanks