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

com.antiaction.raptor.sql.DBWrapper Maven / Gradle / Ivy

/*
 * Created on 17/04/2010
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */

package com.antiaction.raptor.sql;

import java.sql.Connection;
import java.sql.SQLException;
import java.util.List;
import java.util.Map;

import com.antiaction.raptor.dao.AttributeBase;
import com.antiaction.raptor.dao.AttributeTypeBase;
import com.antiaction.raptor.dao.EntityBase;
import com.antiaction.raptor.dao.EntityTypeBase;
import com.antiaction.raptor.dao.SecurityChain;
import com.antiaction.raptor.dao.SecurityEntityBase;
import com.antiaction.raptor.dao.SecurityGrantOnType;
import com.antiaction.raptor.dao.SecurityPermission;
import com.antiaction.raptor.dao.SecurityPermissionType;
import com.antiaction.raptor.dao.SecurityRule;
import com.antiaction.raptor.dao.TreeItem;
import com.antiaction.raptor.dao.ViewBase;
import com.antiaction.raptor.dao.ViewTypeBase;
import com.antiaction.raptor.i18n.I18N;
import com.antiaction.raptor.i18n.Language;
import com.antiaction.raptor.sql.mssql.TreeEntry;
import com.antiaction.raptor.sql.mssql.TreePath;

public abstract class DBWrapper {

	public abstract Connection getConnection() throws SQLException;

	/*
	 * Languages.
	 */

	public abstract List getLanguages(Connection conn) throws SQLException;

	/*
	 * I18N.
	 */

	public abstract I18N getI18N(Connection conn, int translation_id) throws SQLException;

	/*
	 * Views.
	 */

	public abstract List getViews(Connection conn, ClassLoader classLoader);

	/*
	 * Tree.
	 */

	/**
	 * Insert an id into the tree by inserting...
	 */
	public abstract void tree_insert(Connection conn, int tree_id, int parent_id, int id) throws SQLException;

	/**
	 * Delete an id from the tree by deleting all its children and the entries to each parent along the path to root.
	 */
	public abstract int tree_delete(Connection conn, int tree_id, int id) throws SQLException;

	public abstract void tree_move(Connection conn, int tree_id, int id, int to_parent_id);

	public abstract List getParentTreePathList(Connection conn, int tree_id, int id);

	public abstract List getParentPathIds(Connection conn, int tree_id, int id) throws SQLException;

	public abstract List getSubtreeComplete(Connection conn, int tree_id, int id);

	public abstract List getSubtree(Connection conn, int tree_id, int id);

	public abstract int getSubtreeCount(Connection conn, int tree_id, int id) throws SQLException;

	/*
	 * View types.
	 */

	public abstract List getViewTypes(Connection conn);

	public abstract void viewtype_update(Connection conn, ViewTypeBase viewType);

	public abstract void viewtype_deleteByObj(Connection conn, ViewTypeBase viewType);

	public abstract void viewtype_deleteById(Connection conn, int id);

	/*
	 * Entity types.
	 */

	public abstract EntityTypeBase entitytype_insert(Connection conn, ClassLoader classLoader, int tree_id, int id, String name, String class_namespace, String class_name);

	public abstract List getEntityTypes(Connection conn, ClassLoader classLoader, int tree_id);

	public abstract void entitytype_update(Connection conn, EntityTypeBase entityType);

	public abstract void entitytype_deleteByObj(Connection conn, EntityTypeBase entityType);

	public abstract void entitytype_deleteById(Connection conn, int tree_id, int id);

	/*
	 * Attribute types.
	 */

	public abstract void attributetype_insert(Connection conn, AttributeTypeBase attributeType);

	public abstract List getAttributeTypes(Connection conn, ClassLoader classLoader, int tree_id);

	public abstract void attributetype_update(Connection conn, AttributeTypeBase attributeType);

	public abstract void attributetype_deleteByObj(Connection conn, AttributeTypeBase attributeType);

	public abstract void attributetype_deleteById(Connection conn, int tree_id, int id);

	/*
	 * Entity.
	 */

	public abstract SqlResult entity_insert(Connection conn, int tree_id, int type_id);

	public abstract SqlResult entity_getById(Connection conn, int tree_id, int id);

	public abstract void entity_update(Connection conn, EntityBase entity);

	public abstract void entity_deleteByObj(Connection conn, EntityBase entity);

	public abstract void entity_deleteById(Connection conn, int tree_id, int id);

	public abstract void entities_deleteSubtreeByObj(Connection conn, EntityBase entity);

	public abstract void entities_deleteSubtreeById(Connection conn, int tree_id, int id);

	public abstract List entity_children(Connection conn, int tree_id, int parent_id);

	/*
	 * Attribute.
	 */

	public abstract void attribute_insert(Connection conn, AttributeBase attribute);

	public abstract SqlResult attributes_getAttributes(Connection conn, int tree_id, int entity_id);

	public abstract SqlResult attributes_getTypedAttributes(Connection conn, int tree_id, int entity_id);

	public abstract void attribute_update(Connection conn, AttributeBase attribute);

	public abstract void attribute_deleteByObj(Connection conn, AttributeBase attribute);

	public abstract void attribute_deleteById(Connection conn, int tree_id, int attribute_id, int entity_id);

	public abstract void attributes_deleteByEntityObj(Connection conn, EntityBase entity);

	public abstract void attributes_deleteByEntityId(Connection conn, int tree_id, int entity_id);

	public abstract void attributes_deleteSubtreeByObj(Connection conn, EntityBase entity);

	public abstract void attributes_deleteSubtreeByEntityId(Connection conn, int tree_id, int entity_id);

	/*
	 * Security entity.
	 */

	public abstract SqlResult securityentity_insert(Connection conn, int tree_id, int type_id);

	public abstract SqlResult securityentity_getById(Connection conn, int tree_id, int id);

	public abstract SqlResult securityentity_getByLoginCredentials(Connection conn, int tree_id, String login);			// , String password

	public abstract void securityentity_update(Connection conn, SecurityEntityBase securityEntity);

	public abstract void securityentity_deleteByObj(Connection conn, SecurityEntityBase securityEntity);

	public abstract void securityentity_deleteById(Connection conn, int tree_id, int id);

	public abstract void securityentities_deleteSubtreeByObj(Connection conn, SecurityEntityBase securityEntity);

	public abstract void securityentities_deleteSubtreeById(Connection conn, int tree_id, int id);

	public abstract List securityentity_children(Connection conn, int tree_id, int parent_id);

	/*
	 * Security tree permission types.
	 */

	public abstract List getPermissionTypes(Connection conn);

	/*
	 * Security tree grant types.
	 */

	public abstract List getGrantOnTypes(Connection conn);

	/*
	 * Security tree permission.
	 */

	public abstract int tree_permission_insert(Connection conn, SecurityPermission permission);

	public abstract SecurityPermission tree_permission_getById(Connection conn, int id);

	public abstract void tree_permission_update(Connection conn, SecurityPermission permission);

	public abstract void tree_permission_deleteByObj(Connection conn, SecurityPermission permission);

	public abstract void tree_permission_deleteById(Connection conn, int id);

	/*
	 * Security tree chain.
	 */

	public abstract int tree_chain_insert(Connection conn, SecurityChain chain);

	public abstract SecurityChain tree_chain_getById(Connection conn, int id);

	public abstract void tree_chain_update(Connection conn, SecurityChain chain);

	public abstract void tree_chain_deleteByObj(Connection conn, SecurityChain chain);

	public abstract void tree_chain_deleteById(Connection conn, int id);

	public abstract void tree_chain_deleteByPermissionObj(Connection conn, SecurityPermission permission);

	public abstract void tree_chain_deleteByPermissionId(Connection conn, int permission_id);

	/*
	 * Security tree rule.
	 */

	public abstract int tree_rule_insert(Connection conn, SecurityRule grant);

	public abstract SecurityRule tree_rule_getById(Connection conn, int id);

	public abstract void tree_rule_update(Connection conn, SecurityRule grant);

	public abstract void tree_rule_deleteByObj(Connection conn, SecurityRule grant);

	public abstract void tree_rule_deleteById(Connection conn, int id);

	public abstract void tree_rule_deleteByChainObj(Connection conn, SecurityChain chain);

	public abstract void tree_rule_deleteByChainId(Connection conn, int chain_id);

	public abstract void tree_rule_deleteByPermissionObj(Connection conn, SecurityPermission permission);

	public abstract void tree_rule_deleteByPermissionId(Connection conn, int permission_id);

	public abstract Map getPermissionsByUserObj(Connection conn, SecurityEntityBase securityEntity);

	public abstract Map getPermissionsByUserId(Connection conn, int tree_id, int user_id);

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy