com.enterprisemath.dao.relational.EntityDao Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of em-dao Show documentation
Show all versions of em-dao Show documentation
Simple and powerful data access layer.
package com.enterprisemath.dao.relational;
import java.util.List;
import java.util.Set;
import com.enterprisemath.dao.filter.Criterium;
import com.enterprisemath.dao.filter.Filter;
import java.util.Collection;
import java.util.Map;
/**
* Defines data access layer for manipulation with entities.
*
* Note: Adding functions to this interface will NOT be
* considered as breaking binary compatibility.
*
* For entities criteria columns are defined according the following rules.
*
* - Core columns are code, name, created_timestamp, type and parent_code
* - Join values has format join_table_name.property_name
*
*
* For profiles criteria columns are code, entity_code, profile_key, profile_value.
*
* @author radek.hecl
*
*/
public interface EntityDao {
/**
* Inserts the specified entity.
*
* @param entity entity to be inserted
*/
public void insertEntity(Entity entity);
/**
* Deletes the specified entity. All entity data and relations are deleted.
*
* @param code entity code
*/
public void deleteEntity(String code);
/**
* Selects all entities which satisfies the specified criteria.
*
* @param joinsData data from other tables which will be returned in the joins property in table_name.column_name format
* @param filter filter object
* @return entities which match the filter
*/
public List selectEntities(Set joinsData, Filter filter);
/**
* Counts all entities which satisfies the specified criteria.
*
* @param joinsData data from other tables which should be joined during count in table_name.column_name format
* @param criteria criteria with column in the entity format
* @return how many entities satisfies the criteria
*/
public long countEntities(Set joinsData, List> criteria);
/**
* Updates entity name.
*
* @param code code of the entity
* @param name new name of the entity
*/
public void updateEntityName(String code, String name);
/**
* Inserts entity joins.
*
* @param code identification code
* @param table table name
* @param values values where key is column name
*/
public void insertEntityJoins(String code, String table, Map values);
/**
* Updates the specified entity join.
*
* @param code entity code
* @param join identification of the join, format is table_name.column_name
* @param value new value which will be used
*/
public void updateEntityJoin(String code, String join, Object value);
/**
* Deletes entity joins.
*
* @param code identification code
* @param table table name
*/
public void deleteEntityJoins(String code, String table);
/**
* Inserts entity profiles.
*
* @param entityProfiles entity profiles
*/
public void insertProfiles(Collection entityProfiles);
/**
* Deletes profile values which matches the specified filter.
*
* @param criteria criteria for the profile values
*/
public void deleteProfiles(List> criteria);
/**
* Selects all entity profiles which matches the specified filter.
*
* @param filter filter
* @return entity profiles
*/
public List selectProfiles(Filter filter);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy