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

com.cedarsoft.gdao.AbstractGenericDao Maven / Gradle / Ivy

There is a newer version: 1.6.3
Show newest version
package com.cedarsoft.gdao;

import org.jetbrains.annotations.NotNull;

import java.util.List;

/**
 * Offers implementations of the methods of {@link com.cedarsoft.WriteableObjectAccess}
 *
 * @param  the type
 */
public abstract class AbstractGenericDao implements GenericDao {
  public final void remove( @NotNull T element ) {
    delete( element );
  }

  public final void add( @NotNull T element ) {
    saveOrUpdate( element );
  }

  public void commit( @NotNull T element ) {
    update( element );
  }

  @NotNull
  public final List getElements() {
    return findAll();
  }

  public void setElements( @NotNull List elements ) {
    throw new UnsupportedOperationException( "Not supported for daos" );
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy