Before the changes were saved https://i.stack.imgur.com/hjpXa.jpg
After the changes were saved https://i.stack.imgur.com/xABzN.jpg
@Entity
@JsonIgnoreProperties({"hibernateLazyInitializer", "handler"})
public class Notification {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long notificationId;
private Long businessId;
private String actionBy;
private String date;
private String notification;
public ArrayList<UserNotification> user;
//constructor goes here
//getters and setters go here
}
Additionally, here is the UserNotification.java file:
public class UserNotification {
private Long id;
private String user;
private String notifCount;
//getters and setters go here
}
I am encountering an issue where it returns null. I am trying to identify my mistake.
UPDATE:
var usersObj=[];
BusinessRoleService.getByBusinessId($sessionStorage.businessRole.business).then(function(response){
if(response.status==200){
for(var x=0;x<response.data.length;x++){
usersObj.push({id: x, user: response.data[x].userId, notifCount: $scope.notification});
}
}
});
var obj = {
"businessId": businessId,
"actionBy": user,
"date": date,
"notification": user+" "+action,
"user": usersObj
}
Once the object is created, I will proceed to pass it to my service for saving.
Below is a snapshot of how my database appears after the updates have been saved: