Package com.maker.idmaker
Class IDMakerEntityListener
java.lang.Object
com.maker.idmaker.IDMakerEntityListener
A listener that checks for fields annotated with
IDMaker
and generates an ID for them if they are null.- Since:
- 2024. 5. 31.
- Author:
- yongjunhong
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
prePersist
(Object entity) Method that gets called before an entity gets persisted.
-
Constructor Details
-
IDMakerEntityListener
public IDMakerEntityListener()
-
-
Method Details
-
prePersist
Method that gets called before an entity gets persisted. This method checks all fields of the entity for theIDMaker
annotation and generates an ID for them if they are null.- Parameters:
entity
- the entity that is about to be persisted- Throws:
IDMakerAccessException
- if there is an error accessing the fields of the entity
-