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

io.github.mmm.orm.spi.session.AbstractDbEntityHolder Maven / Gradle / Ivy

There is a newer version: 0.9.8
Show newest version
package io.github.mmm.orm.spi.session;

import io.github.mmm.bean.BeanHelper;
import io.github.mmm.entity.bean.EntityBean;

/**
 * Abstract base implementation of {@link DbEntityHolder}.
 *
 * @param  type of the managed {@link EntityBean}.
 * @since 1.0.0
 */
public abstract class AbstractDbEntityHolder implements DbEntityHolder {

  /** @see #getInternal() */
  protected final E internal;

  /**
   * The constructor.
   *
   * @param internal the {@link #getInternal() internal entity}.
   */
  public AbstractDbEntityHolder(E internal) {

    super();
    this.internal = internal;
  }

  @Override
  public E getInternal() {

    return this.internal;
  }

  @Override
  public void update(E entity) {

    // TODO only copy non-transient properties...
    BeanHelper.copy(entity, this.internal);
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy