Added onBeforeSave entity lifecycle