Перед сохранением ![enter image description here](https://i.stack.imgur.com/hjpXa.jpg)
После сохранения ![enter image description here](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 here
//getters setters here
}
и UserNotification.java равен
public class UserNotification {
private Long id;
private String user;
private String notifCount;
//getters setters here
}
Я не знаю, почему он возвращает ноль.В какой момент я допустил ошибку?
РЕДАКТИРОВАТЬ:
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
}
, тогда я передам объект для обслуживания, чтобы сохранить
Так выглядит моя база данных послеэкономия
![enter image description here](https://i.stack.imgur.com/c1Hzk.jpg)