-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
area/mongodbarea/panachekind/questionFurther information is requestedFurther information is requested
Description
Hi guys, hope you are doing well.
In JPA it is possible to use annotations such as @PrePersist, @PostPersist
to execute oparations before and after the persist/merge
.
What if we implement this on mongodb panache, I took a look and it seems pretty simple to implement.
We can use the MongoOperations.persist
, and MongoOperations.update
to apply a kind of interceptor scanning the entity for a method using these annotations, and execute those methods.
Bellow a snippet of code:
@PrePersist
public void prePersist() {
System.out.println("prePersis");
}
@PostPersist
public void postPersist() {
System.out.println("postPersist");
}
I didn't send this yet for the [email protected], let me know if this idea is a good, and if I have to send to googlegroups.
Best,
Metadata
Metadata
Assignees
Labels
area/mongodbarea/panachekind/questionFurther information is requestedFurther information is requested