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

io.github.mmm.orm.spi.access.DbUpdateAccess Maven / Gradle / Ivy

There is a newer version: 0.9.8
Show newest version
/* Copyright (c) The m-m-m Team, Licensed under the Apache License, Version 2.0
 * http://www.apache.org/licenses/LICENSE-2.0 */
package io.github.mmm.orm.spi.access;

import io.github.mmm.entity.bean.EntityBean;
import io.github.mmm.orm.statement.update.UpdateStatement;

/**
 * Interface providing support for {@link #update(UpdateStatement)}.
 */
public interface DbUpdateAccess {

  /**
   * @param statement the {@link UpdateStatement} to execute.
   * @return the number of records that have been deleted.
   */
  long update(UpdateStatement statement);

  /**
   * @param entity the {@link EntityBean} to update.
   */
  void update(EntityBean entity);

  /**
   * @param entities the {@link EntityBean}s to update as batch operation.
   */
  default void updateAll(EntityBean... entities) {

    for (EntityBean entity : entities) {
      update(entity);
    }
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy