io.github.mmm.orm.spi.session.AbstractDbEntityHolder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mmm-orm-spi Show documentation
Show all versions of mmm-orm-spi Show documentation
Service Provider API (SPI) for mmm-orm.
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);
}
}