Class IDMakerEntityListener

java.lang.Object
com.maker.idmaker.IDMakerEntityListener

@Component public class IDMakerEntityListener extends Object
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 Details

    • IDMakerEntityListener

      public IDMakerEntityListener()
  • Method Details

    • prePersist

      @Transactional public void prePersist(Object entity)
      Method that gets called before an entity gets persisted. This method checks all fields of the entity for the IDMaker 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