In service layer, we got
@Service
@Transactional(readOnly = false)
public abstract class GenericService
In repository layer, we got
public abstract class GenericRepository
In service we have a save method that calls the save method of repository, which is
@Override
public void savePersist(T entity) {
getSession().persist(entity);
}
All I want to do is to save the object "entity" into hibernate session for further processing, without commit or any insert statement into database. but what actually happens is saving "entity" after running the savePersist(). I think this because of using @Transactional annotation on service class. But what should I do for save the entity in session?