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

com.enterprisemath.dao.relational.MyBatisEntityMapper Maven / Gradle / Ivy

There is a newer version: 4.3.2
Show newest version
package com.enterprisemath.dao.relational;

import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Set;

import org.apache.ibatis.annotations.Param;

import com.enterprisemath.dao.filter.Criterium;
import com.enterprisemath.dao.filter.Filter;
import java.util.Collection;

/**
 * My batis mapper for entity objects.
 * This is internal class and might be changed or removed at any time.
 * 
 * @author radek.hecl
 *
 */
public interface MyBatisEntityMapper {

    /**
     * Inserts the entity core.
     *
     * @param code code of the entity, this is the unique identifier
     * @param name name of the entity
     * @param createdTimestamp timestamp when entity was created
     * @param parentCode code of the parent entity
     * @param type type of the entity
     */
    public void insertEntityCore(
            @Param("code") String code,
            @Param("name") String name,
            @Param("createdTimestamp") Date createdTimestamp,
            @Param("parent_code") String parentCode,
            @Param("type") String type);

    /**
     * Insert joins into specified table for the specified entity.
     *
     * @param code code of the entity
     * @param table table name for join
     * @param join join values for the table
     */
    public void insertEntityJoins(@Param("code") String code, @Param("table") String table, @Param("join") Map join);

    /**
     * Deletes joins from the specified entity and table.
     *
     * @param code identification code
     * @param table join table
     */
    public void deleteEntityJoins(@Param("code") String code, @Param("table") String table);

    /**
     * Selects entities core according the filter.
     *
     * @param joins joins which are selected together with entities
     * @param filter filter to be used
     * @return list with selected entities
     */
    public List> selectEntities(@Param("joins") Map> joins, @Param("filter") Filter filter);

    /**
     * Counts entities.
     *
     * @param tables tables which are involved in counting
     * @param criteria criteria used for counting
     * @return how many entities satisfies the criteria
     */
    public long countEntities(@Param("tables") Set tables, @Param("criteria") Set> criteria);

    /**
     * Deletes the specified entity.
     *
     * @param code entity code
     */
    public void deleteEntity(@Param("code") String code);

    /**
     * Updates entity name.
     *
     * @param code code of the entity
     * @param name name of the entity
     */
    public void updateEntityName(@Param("code") String code, @Param("name") String name);

    /**
     * Updates join.
     *
     * @param code code of the entity
     * @param table table which will be updated
     * @param column column which will be updated
     * @param value value which will be used
     */
    public void updateEntityJoin(@Param("code") String code, @Param("table") String table,
            @Param("column") String column, @Param("value") Object value);

    /**
     * Inserts the entity profile.
     *
     * @param code identification code
     * @param entityCode entity code
     * @param key key
     * @param value value
     */
    public void insertProfile(
            @Param("code") String code,
            @Param("entity_code") String entityCode,
            @Param("profile_key") String key,
            @Param("profile_value") String value);

    /**
     * Delete entity profiles.
     *
     * @param criteria criteria
     */
    public void deleteProfiles(@Param("criteria") Collection> criteria);

    /**
     * Selects entity profiles.
     *
     * @param filter filter
     * @return selected profiles
     */
    public List> selectProfiles(@Param("filter") Filter filter);

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy