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

com.ivanceras.db.api.EntityManager Maven / Gradle / Ivy

There is a newer version: 0.1.2
Show newest version
package com.ivanceras.db.api;

import java.io.OutputStream;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;

import com.ivanceras.db.shared.DAO;
import com.ivanceras.db.shared.Filter;
import com.ivanceras.db.shared.Order;
import com.ivanceras.db.shared.exception.DatabaseException;
import com.ivanceras.fluent.sql.SQL;

public interface EntityManager{


	/**
	 * @author lee
	 * @throws DatabaseException
	 */
	public void beginTransaction() throws DatabaseException;

	public  T cast(Class daoClass, DAO dao) throws DatabaseException;

	public  T[] cast(Class daoClass, DAO[] daoList)
			throws DatabaseException;

	public void commitTransaction() throws DatabaseException;

	public int count(Query query) throws DatabaseException;

	public boolean createModel(ModelDef model) throws DatabaseException;

	public boolean createSchema(String schema) throws DatabaseException;

	public int delete(Class daoClass, Filter... filters) throws DatabaseException;

	public int delete(DAO dao) throws DatabaseException;

	public boolean drop(Class daoClass) throws DatabaseException;

	public boolean drop(Class daoClass, boolean forced) throws DatabaseException;

	public void dropNameSpace(String schema, boolean forced) throws DatabaseException;

	public int empty(Class daoClass) throws DatabaseException;

	public int empty(ClassdaoClass, boolean forced) throws DatabaseException;

	public boolean exist(DAO dao) throws DatabaseException;

	public boolean existModel(ModelDef model) throws DatabaseException;

	public void finalize() throws Throwable;

	public  T[] getAll(Class daoClass) throws DatabaseException;


	public  T[] getAll(Class daoClass, Boolean distinct) throws DatabaseException;

	public  T[] getAll(Class daoClass, Filter... filters) throws DatabaseException;

	public  T[] getAll(Class daoClass, Order order, Filter... filters) throws DatabaseException;

	public byte[] getBlob(long oid) throws DatabaseException;

	public Class getDaoClass(String modelName) throws DatabaseException;

	public IDatabase getDB();

	public ModelDef getDefinition(Class daoClass) throws DatabaseException;

	public  T getMatch(DAO dao, Boolean exactMatch)  throws DatabaseException;

	public String getModelName(Class daoClass) throws DatabaseException;

	public  T getOne(Class daoClass, Filter... filters)  throws DatabaseException;

	public  T getOne(DAO dao) throws DatabaseException;

	public  T insert(DAO dao) throws DatabaseException;
	
	public  T insert(DAO dao, boolean excludePrimaryKeys) throws DatabaseException;

	public  T insertNoChangeLog(DAO dao, ModelDef model) throws DatabaseException;

	public  T match(DAO dao) throws DatabaseException;

	public void resetDB();

	public  T[] retrieveRecords(Query query) throws DatabaseException;

	public  T[] retrieveRecords(Query query, boolean autoCast) throws DatabaseException;

	public void rollbackTransaction() throws DatabaseException;

	public  T[]  execute(SQL sql) throws DatabaseException;

	public DAO[]  execute(String sql, Object[] parameters) throws DatabaseException;

	public  T[] execute(SQL sql, Map renamedColumns)
			throws DatabaseException;

//	void setContextProvider(ContextProvider context);

	public boolean setForeignConstraint(ModelDef model) throws DatabaseException;

	
	public void startPrintSqls();

	public void stopPrintSqls();

	public  T update(DAO dao) throws DatabaseException;

	public  T update(DAO dao, Filter...filters) throws DatabaseException;

	long writeToBlob(byte[] buf) throws DatabaseException;

	public long writeToBlob(String filename) throws DatabaseException;

	public void writeToOutputStream(Long blob_data, OutputStream out) throws DatabaseException;

	public void setContext(String key, Object value);
	
	public Map getContext();
	
	public Object getContext(String key);

	public boolean setPrimaryConstraint(ModelDef model) throws DatabaseException;

	
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy