congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
SimpleJpaRepository.delete
Code IndexAdd Tabnine to your IDE (free)

How to use
delete
method
in
org.springframework.data.jpa.repository.support.SimpleJpaRepository

Best Java code snippets using org.springframework.data.jpa.repository.support.SimpleJpaRepository.delete (Showing top 16 results out of 315)

origin: spring-projects/spring-data-jpa

@Transactional
@Override
public void deleteAll(Iterable<? extends T> entities) {
  Assert.notNull(entities, "The given Iterable of entities not be null!");
  for (T entity : entities) {
    delete(entity);
  }
}
origin: spring-projects/spring-data-jpa

@Transactional
@Override
public void deleteAll() {
  for (T element : findAll()) {
    delete(element);
  }
}
origin: spring-projects/spring-data-jpa

@Transactional
@Override
public void deleteById(ID id) {
  Assert.notNull(id, ID_MUST_NOT_BE_NULL);
  delete(findById(id).orElseThrow(() -> new EmptyResultDataAccessException(
      String.format("No %s entity with id %s exists!", entityInformation.getJavaType(), id), 1)));
}
origin: net.osgiliath.modules/net.osgiliath.module.spring-data-jpa

@Override
public void delete(ID id) {
 delegate.delete(id);
}
origin: net.osgiliath.modules/net.osgiliath.module.spring-data-jpa

@Override
public void delete(Iterable<? extends T> entities) {
 delegate.delete(entities);
}
origin: net.osgiliath.modules/net.osgiliath.module.spring-data-jpa

@Override
public void delete(T entity) {
 delegate.delete(entity);
}
origin: xautlx/s2jh4net

/**
 * 数据删除操作
 *
 * @param entity 待操作数据
 */
@Transactional
public void delete(T entity) {
  jpaRepository.delete(entity);
}
origin: org.springframework.data/spring-data-jpa

@Transactional
public void deleteAll(Iterable<? extends T> entities) {
  Assert.notNull(entities, "The given Iterable of entities not be null!");
  for (T entity : entities) {
    delete(entity);
  }
}
origin: org.springframework.data/spring-data-jpa

@Transactional
public void deleteAll() {
  for (T element : findAll()) {
    delete(element);
  }
}
origin: terrymanu/miracle-framework

  @Override
  @Transactional
  public void delete(final I id) {
    findOne(id);
    super.delete(id);
  }
}
origin: com.ecfront.dew/boot-core

@Override
@Transactional
public void deleteByCode(String code) {
  super.delete(getByCode(code));
  entityManager.flush();
}
origin: com.ecfront.dew/boot-core

@Override
@Transactional
public void deleteById(long id) {
  super.delete(getById(id));
  entityManager.flush();
}
origin: org.springframework.data/spring-data-jpa

@Transactional
public void deleteById(ID id) {
  Assert.notNull(id, ID_MUST_NOT_BE_NULL);
  delete(findById(id).orElseThrow(() -> new EmptyResultDataAccessException(
      String.format("No %s entity with id %s exists!", entityInformation.getJavaType(), id), 1)));
}
origin: com.intoverflow.booster/booster-core

/**
 * 删除实体
 *
 * @param entity 实体
 */
@Transactional
@Override
public void delete(final M entity) {
  if (entity == null) {
    return;
  }
  if (entity instanceof DeletedRecordable) {
    ((DeletedRecordable) entity).setDeleted(Boolean.TRUE);
    save(entity);
  } else {
    super.delete(entity);
  }
}
origin: xautlx/s2jh4net

  /**
   * 数据删除操作
   *
   * @param entity 待操作数据
   */
  @Transactional
  @Override
  public void delete(T entity) {
    Validation.isTrue(!entity.hasChildren(), "只允许删除子节点");

    //记录删除对象的左右值
    Integer left = entity.getLft();
    Integer right = entity.getRgt();

    //先删除当前对象
    jpaRepository.delete(entity);
    entityManager.flush();

    //删除节点后,移动右侧节点。注意此算法需要确保已递归删除所有子节点,如果出现孤儿节点情况则会有问题。
    int width = right - left + 1;
    Query update1 = entityManager.createQuery("update " + entityName + " set rgt = rgt - :width where rgt > :rightParam");
    Query update2 = entityManager.createQuery("update " + entityName + " set lft = lft - :width where lft > :rightParam");
    update1.setParameter("rightParam", right);
    update2.setParameter("rightParam", right);
    update1.setParameter("width", width);
    update2.setParameter("width", width);
    int cnt1 = update1.executeUpdate();
    int cnt2 = update2.executeUpdate();
  }
}
origin: com.github.dactiv/dactiv-orm

@Override
@Transactional
public void delete(T entity) {
  for (OrmDeleteInterceptor<T,JpaSupportRepository<T, ID>> interceptor : deleteInterceptors) {
    ID id = ReflectionUtils.invokeGetterMethod(entity, getIdName());
    if (!interceptor.onDelete(id, entity, this)) {
      return ;
    }
  }
  
  super.delete(entity);
  
  for (OrmDeleteInterceptor<T,JpaSupportRepository<T, ID>> interceptor : deleteInterceptors) {
    ID id = ReflectionUtils.invokeGetterMethod(entity, getIdName());
    interceptor.onPostDelete(id, entity, this);
  }
  
}
org.springframework.data.jpa.repository.supportSimpleJpaRepositorydelete

Popular methods of SimpleJpaRepository

  • findAll
  • findOne
  • count
  • save
  • readPage
    Reads the given TypedQuery into a Page applying the given Pageable and Specification.
  • exists
  • findById
  • flush
  • getCountQuery
    Creates a new count query for the given Specification.
  • getQuery
    Creates a TypedQuery for the given Specification and Sort.
  • <init>
    Creates a new SimpleJpaRepository to manage objects of the given JpaEntityInformation.
  • applyQueryHints
  • <init>,
  • applyQueryHints,
  • applyRepositoryMethodMetadata,
  • applySpecificationToCriteria,
  • deleteAll,
  • deleteAllInBatch,
  • deleteInBatch,
  • executeCountQuery,
  • getCountQueryString

Popular in Java

  • Reactive rest calls using spring rest template
  • runOnUiThread (Activity)
  • scheduleAtFixedRate (Timer)
  • getContentResolver (Context)
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • Collectors (java.util.stream)
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • JTable (javax.swing)
  • Join (org.hibernate.mapping)
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now