public class GenericDAO extends Object
Constructor and Description |
---|
GenericDAO(GenericHelperInfo helperInfo) |
Modifier and Type | Method and Description |
---|---|
void |
checkDb(Map<String,ModelEntity> modelEntities,
List<String> messages,
boolean addMissing) |
int |
delete(GenericEntity entity) |
int |
delete(GenericEntity entity,
SQLProcessor sqlP) |
int |
deleteByCondition(Delegator delegator,
ModelEntity modelEntity,
EntityCondition condition) |
int |
deleteByCondition(ModelEntity modelEntity,
EntityCondition condition,
SQLProcessor sqlP) |
static GenericDAO |
getGenericDAO(GenericHelperInfo helperInfo) |
List<ModelEntity> |
induceModelFromDb(Collection<String> messages)
Creates a list of ModelEntity objects based on meta data from the database
|
int |
insert(GenericEntity entity) |
protected StringBuilder |
makeConditionHavingString(ModelEntity modelEntity,
EntityCondition havingEntityCondition,
List<EntityCondition> viewHavingConditions,
List<EntityConditionParam> havingEntityConditionParams)
Deprecated.
|
protected StringBuilder |
makeConditionHavingString(StringBuilder havingString,
String prefix,
ModelEntity modelEntity,
EntityCondition havingEntityCondition,
List<EntityCondition> viewHavingConditions,
List<EntityConditionParam> havingEntityConditionParams) |
protected StringBuilder |
makeConditionWhereString(ModelEntity modelEntity,
EntityCondition whereEntityCondition,
List<EntityCondition> viewWhereConditions,
List<EntityConditionParam> whereEntityConditionParams)
Deprecated.
|
protected StringBuilder |
makeConditionWhereString(StringBuilder whereString,
String prefix,
ModelEntity modelEntity,
EntityCondition whereEntityCondition,
List<EntityCondition> viewWhereConditions,
List<EntityConditionParam> whereEntityConditionParams) |
protected StringBuilder |
makeOffsetString(StringBuilder offsetString,
EntityFindOptions findOptions) |
void |
partialSelect(GenericEntity entity,
Set<String> keys) |
void |
select(GenericEntity entity) |
void |
select(GenericEntity entity,
SQLProcessor sqlP) |
List<GenericValue> |
selectByMultiRelation(GenericValue value,
ModelRelation modelRelationOne,
ModelEntity modelEntityOne,
ModelRelation modelRelationTwo,
ModelEntity modelEntityTwo,
List<String> orderBy) |
long |
selectCountByCondition(Delegator delegator,
ModelEntity modelEntity,
EntityCondition whereEntityCondition,
EntityCondition havingEntityCondition,
EntityFindOptions findOptions) |
long |
selectCountByCondition(Delegator delegator,
ModelEntity modelEntity,
EntityCondition whereEntityCondition,
EntityCondition havingEntityCondition,
List<ModelField> selectFields,
EntityFindOptions findOptions) |
EntityListIterator |
selectListIteratorByCondition(Delegator delegator,
ModelEntity modelEntity,
EntityCondition whereEntityCondition,
EntityCondition havingEntityCondition,
Collection<String> fieldsToSelect,
List<String> orderBy,
EntityFindOptions findOptions)
Finds GenericValues by the conditions specified in the EntityCondition object, the the EntityCondition javadoc for more details.
|
int |
update(GenericEntity entity) |
int |
updateAll(GenericEntity entity) |
int |
updateByCondition(Delegator delegator,
ModelEntity modelEntity,
Map<String,? extends Object> fieldsToSet,
EntityCondition condition) |
int |
updateByCondition(ModelEntity modelEntity,
Map<String,? extends Object> fieldsToSet,
EntityCondition condition,
SQLProcessor sqlP) |
public static final String module
public GenericDAO(GenericHelperInfo helperInfo)
public static GenericDAO getGenericDAO(GenericHelperInfo helperInfo)
public int insert(GenericEntity entity) throws GenericEntityException
GenericEntityException
public int updateAll(GenericEntity entity) throws GenericEntityException
GenericEntityException
public int update(GenericEntity entity) throws GenericEntityException
GenericEntityException
public int updateByCondition(Delegator delegator, ModelEntity modelEntity, Map<String,? extends Object> fieldsToSet, EntityCondition condition) throws GenericEntityException
GenericEntityException
public int updateByCondition(ModelEntity modelEntity, Map<String,? extends Object> fieldsToSet, EntityCondition condition, SQLProcessor sqlP) throws GenericEntityException
GenericEntityException
public void select(GenericEntity entity) throws GenericEntityException
GenericEntityException
public void select(GenericEntity entity, SQLProcessor sqlP) throws GenericEntityException
GenericEntityException
public void partialSelect(GenericEntity entity, Set<String> keys) throws GenericEntityException
GenericEntityException
public EntityListIterator selectListIteratorByCondition(Delegator delegator, ModelEntity modelEntity, EntityCondition whereEntityCondition, EntityCondition havingEntityCondition, Collection<String> fieldsToSelect, List<String> orderBy, EntityFindOptions findOptions) throws GenericEntityException
modelEntity
- The ModelEntity of the Entity as defined in the entity XML filewhereEntityCondition
- The EntityCondition object that specifies how to constrain this query before any groupings are done (if this is a view entity with group-by aliases)havingEntityCondition
- The EntityCondition object that specifies how to constrain this query after any groupings are done (if this is a view entity with group-by aliases)fieldsToSelect
- The fields of the named entity to get from the database; if empty or null all fields will be retreivedorderBy
- The fields of the named entity to order the query by; optionally add a " ASC" for ascending or " DESC" for descendingfindOptions
- An instance of EntityFindOptions that specifies advanced query options. See the EntityFindOptions JavaDoc for more details.GenericEntityException
@Deprecated protected StringBuilder makeConditionWhereString(ModelEntity modelEntity, EntityCondition whereEntityCondition, List<EntityCondition> viewWhereConditions, List<EntityConditionParam> whereEntityConditionParams) throws GenericEntityException
GenericEntityException
protected StringBuilder makeConditionWhereString(StringBuilder whereString, String prefix, ModelEntity modelEntity, EntityCondition whereEntityCondition, List<EntityCondition> viewWhereConditions, List<EntityConditionParam> whereEntityConditionParams) throws GenericEntityException
GenericEntityException
@Deprecated protected StringBuilder makeConditionHavingString(ModelEntity modelEntity, EntityCondition havingEntityCondition, List<EntityCondition> viewHavingConditions, List<EntityConditionParam> havingEntityConditionParams) throws GenericEntityException
GenericEntityException
protected StringBuilder makeConditionHavingString(StringBuilder havingString, String prefix, ModelEntity modelEntity, EntityCondition havingEntityCondition, List<EntityCondition> viewHavingConditions, List<EntityConditionParam> havingEntityConditionParams) throws GenericEntityException
GenericEntityException
protected StringBuilder makeOffsetString(StringBuilder offsetString, EntityFindOptions findOptions)
public List<GenericValue> selectByMultiRelation(GenericValue value, ModelRelation modelRelationOne, ModelEntity modelEntityOne, ModelRelation modelRelationTwo, ModelEntity modelEntityTwo, List<String> orderBy) throws GenericEntityException
GenericEntityException
public long selectCountByCondition(Delegator delegator, ModelEntity modelEntity, EntityCondition whereEntityCondition, EntityCondition havingEntityCondition, EntityFindOptions findOptions) throws GenericEntityException
GenericEntityException
public long selectCountByCondition(Delegator delegator, ModelEntity modelEntity, EntityCondition whereEntityCondition, EntityCondition havingEntityCondition, List<ModelField> selectFields, EntityFindOptions findOptions) throws GenericEntityException
GenericEntityException
public int delete(GenericEntity entity) throws GenericEntityException
GenericEntityException
public int delete(GenericEntity entity, SQLProcessor sqlP) throws GenericEntityException
GenericEntityException
public int deleteByCondition(Delegator delegator, ModelEntity modelEntity, EntityCondition condition) throws GenericEntityException
GenericEntityException
public int deleteByCondition(ModelEntity modelEntity, EntityCondition condition, SQLProcessor sqlP) throws GenericEntityException
GenericEntityException
public void checkDb(Map<String,ModelEntity> modelEntities, List<String> messages, boolean addMissing)
public List<ModelEntity> induceModelFromDb(Collection<String> messages)