Android Open Source - br.com.mirabilis.sqlite D A O






From Project

Back to project page br.com.mirabilis.sqlite.

License

The source code is released under:

Apache License

If you think the Android project br.com.mirabilis.sqlite listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package br.com.mirabilis.sqlite.manager.dao;
//from   ww w. j ava  2 s .  com
import java.util.List;

import br.com.mirabilis.sqlite.manager.exception.SQLiteEmptyException;
import br.com.mirabilis.sqlite.manager.exception.SQLiteException;
import br.com.mirabilis.sqlite.manager.exception.SQLiteNotNullFieldException;
import android.content.ContentValues;

/**
 * Interface for DAO.
 * 
 * @author Rodrigo Sim?es Rosa.
 * @param <T>
 */
public interface DAO<T> {

  /**
   * Insert {@link ContentValues} data;
   * 
   * @param data
   * @return
   * @throws SQLiteException
   * @throws SQLiteNotNullFieldException
   * @throws IllegalAccessException
   * @throws IllegalArgumentException
   */
  public long insert(T data) throws SQLiteException,
      SQLiteNotNullFieldException;

  /**
   * Insert and return boolean
   * 
   * @param data
   * @return
   * @throws SQLiteException
   * @throws SQLiteNotNullFieldException
   */
  public boolean add(T data) throws SQLiteException,
      SQLiteNotNullFieldException;

  /**
   * Insert and return T
   * 
   * @param data
   * @return
   * @throws SQLiteException
   * @throws SQLiteNotNullFieldException
   */
  public T persist(T data) throws SQLiteException, SQLiteEmptyException,
      SQLiteNotNullFieldException;

  /**
   * Delete {@link T} data;
   * 
   * @param data
   * @return state of transaction;
   */
  public boolean delete(T data) throws SQLiteException;

  /**
   * Update {@link T} data;
   * 
   * @param data
   * @return state of transaction;
   * @throws IllegalAccessException
   * @throws IllegalArgumentException
   * @throws SQLiteNotNullFieldException
   */
  public boolean update(T data) throws SQLiteException,
      SQLiteNotNullFieldException;

  /**
   * Select {@link T} object by ID;
   * 
   * @param id
   *            parameter to select;
   * @return {@link T};
   */
  public T selectByID(long id) throws SQLiteException, SQLiteEmptyException;

  /**
   * Select all {@link T} objects;
   * 
   * @return {@link List<T>};
   */
  public List<T> select() throws SQLiteException, SQLiteEmptyException;

  /**
   * Select all {@link T} by limit;
   * 
   * @param limit
   *            Limit of objects to select
   * @return {@link List<T>};
   */
  public List<T> select(int limit) throws SQLiteException,
      SQLiteEmptyException;

  /**
   * Select all {@link T} by limit;
   * 
   * @param limit
   *            Limit of objects to select
   * @param page
   *            number of page select that depend of limit;
   * @return {@link List<T>};
   */
  public List<T> selectByPage(int limit, int page) throws SQLiteException,
      SQLiteEmptyException;
}




Java Source Code List

br.com.mirabilis.sample.BuildConfig.java
br.com.mirabilis.sample.MainActivity.java
br.com.mirabilis.sqlite.BuildConfig.java
br.com.mirabilis.sqlite.BuildConfig.java
br.com.mirabilis.sqlite.annotation.SQLiteParseAnnotation.java
br.com.mirabilis.sqlite.annotation.model.SQLiteAnnotationEntity.java
br.com.mirabilis.sqlite.annotation.model.SQLiteAnnotationField.java
br.com.mirabilis.sqlite.cypher.CypherFileManager.java
br.com.mirabilis.sqlite.manager.core.SQLiteConnection.java
br.com.mirabilis.sqlite.manager.core.SQLiteCore.java
br.com.mirabilis.sqlite.manager.dao.DAO.java
br.com.mirabilis.sqlite.manager.dao.SQLiteDAO.java
br.com.mirabilis.sqlite.manager.dao.util.SQLiteDataManager.java
br.com.mirabilis.sqlite.manager.dao.util.SQLiteDataType.java
br.com.mirabilis.sqlite.manager.exception.SQLiteEmptyException.java
br.com.mirabilis.sqlite.manager.exception.SQLiteException.java
br.com.mirabilis.sqlite.manager.exception.SQLiteNotNullFieldException.java
br.com.mirabilis.sqlite.manager.model.SQLiteEntity.java
br.com.mirabilis.sqlite.manager.model.SQLiteField.java
br.com.mirabilis.sqlite.manager.model.SQLiteTable.java
br.com.mirabilis.sqlite.manager.util.SQLiteDatabaseFile.java
br.com.mirabilis.sqlite.view.SqliteActivity.java