All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.vladmihalcea.spring.repository.HibernateRepository Maven / Gradle / Ivy

There is a newer version: 2.21.1
Show newest version
package com.vladmihalcea.spring.repository;

import java.util.List;

/**
 * @author Vlad Mihalcea
 */
public interface HibernateRepository {

    //Save methods will trigger an UnsupportedOperationException

    @Deprecated
     S save(S entity);

    @Deprecated
     List saveAll(Iterable entities);

    @Deprecated
     S saveAndFlush(S entity);

    @Deprecated
     List saveAllAndFlush(Iterable entities);

    //Persist methods are meant to save newly created entities

     S persist(S entity);

     S persistAndFlush(S entity);

     List persistAll(Iterable entities);

     List peristAllAndFlush(Iterable entities);

    //Merge methods are meant to propagate detached entity state changes
    //if they are really needed

     S merge(S entity);

     S mergeAndFlush(S entity);

     List mergeAll(Iterable entities);

     List mergeAllAndFlush(Iterable entities);

    //Update methods are meant to force the detached entity state changes

     S update(S entity);

     S updateAndFlush(S entity);

     List updateAll(Iterable entities);

     List updateAllAndFlush(Iterable entities);

}