Reputation: 99
I have a scenario where I need to store the data in a db table called order_AUD. And that order_AUD table is getting shared by 2 different services let's say UserService and OrderService.
So I have an entity as User in UserService with the following properties.
@AUditTable("order_AUD")
public class User {
private String userName;
private String orderId;
@Audited
private int orderQuantity;
}
And I have another OrderDetails Entity in OrderService with the following properties.
@AUditTable("order_AUD")
public class OrderDetails {
private String orderId;
@Audited
private String orderName;
private String userId;
@Audited
private int orderQuantity;
}
Now Suppose we have already a revision present in order_AUD table where the orderName got changed from Foo to Bar So we will have Bar value for the orderName in table. But whenever we do any changes in User entity to update the quantity then a new entry will get created with the updated quantity but it is also made null to the orderName property because this property is not present inside User Entity.
Now, I'm looking for solution where i can persist the orderName also if i make any changes to the quantity via User entity without keeping the orderName in UserEntity.
Thanks.
Upvotes: 0
Views: 22