I need to return values that are set by the database as default values (e.g. created and updated timestamps). I thought doing a findOne() inside postCreate() or postUpdate() would work, but I'm not getting back the expected values.
I'm not sure if the calls to postCreate and postUpdate are in the wrong transaction scope, or if perhaps they're asynchronous and therefore called before the database has been updated.
How would you return database-defaulted values when creating or updating entities?
I need to return values that are set by the database as default values (e.g. created and updated timestamps). I thought doing a findOne() inside postCreate() or postUpdate() would work, but I'm not getting back the expected values.
I'm not sure if the calls to postCreate and postUpdate are in the wrong transaction scope, or if perhaps they're asynchronous and therefore called before the database has been updated.
How would you return database-defaulted values when creating or updating entities?