List of usage examples for org.springframework.data.domain Persistable isNew
boolean isNew();
From source file:org.agatom.springatom.data.hades.repo.factory.NRepositoryImpl.java
@Override public <S extends T> S save(S entity) { if (entity == null) { LOGGER.warn("save(...) called with null argument"); return null; }//from w w w. ja v a2 s . c o m final Persistable<?> persistable = (Persistable<?>) entity; final boolean isNew = persistable.isNew(); this.publishBeforeCreateSaveEvent(entity, isNew); entity = super.save(entity); this.publishAfterCreateSaveEvent(entity, isNew); return entity; }