本文整理汇总了Java中org.ofbiz.entity.GenericNotImplementedException类的典型用法代码示例。如果您正苦于以下问题:Java GenericNotImplementedException类的具体用法?Java GenericNotImplementedException怎么用?Java GenericNotImplementedException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
GenericNotImplementedException类属于org.ofbiz.entity包,在下文中一共展示了GenericNotImplementedException类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: delete
import org.ofbiz.entity.GenericNotImplementedException; //导入依赖的package包/类
public int delete(GenericEntity entity, SQLProcessor sqlP) throws GenericEntityException {
ModelEntity modelEntity = entity.getModelEntity();
if (modelEntity == null) {
throw new GenericModelException("Could not find ModelEntity record for entityName: " + entity.getEntityName());
}
if (modelEntity instanceof ModelViewEntity) {
throw new org.ofbiz.entity.GenericNotImplementedException("Operation delete not supported yet for view entities");
}
StringBuilder sql = new StringBuilder().append("DELETE FROM ").append(modelEntity.getTableName(datasource)).append(" WHERE ");
SqlJdbcUtil.makeWhereStringFromFields(sql, modelEntity.getPkFieldsUnmodifiable(), entity, "AND");
int retVal;
try {
sqlP.prepareStatement(sql.toString());
SqlJdbcUtil.setPkValues(sqlP, modelEntity, entity, modelFieldTypeReader);
retVal = sqlP.executeUpdate();
entity.removedFromDatasource();
} finally {
sqlP.close();
}
return retVal;
}
示例2: deleteByCondition
import org.ofbiz.entity.GenericNotImplementedException; //导入依赖的package包/类
public int deleteByCondition(ModelEntity modelEntity, EntityCondition condition, SQLProcessor sqlP) throws GenericEntityException {
if (modelEntity == null || condition == null)
return 0;
if (modelEntity instanceof ModelViewEntity) {
throw new org.ofbiz.entity.GenericNotImplementedException("Operation deleteByCondition not supported yet for view entities");
}
StringBuilder sql = new StringBuilder("DELETE FROM ").append(modelEntity.getTableName(this.datasource));
String whereCondition = condition.makeWhereString(modelEntity, null, this.datasource);
if (UtilValidate.isNotEmpty(whereCondition)) {
sql.append(" WHERE ").append(whereCondition);
}
try {
sqlP.prepareStatement(sql.toString());
return sqlP.executeUpdate();
} finally {
sqlP.close();
}
}
示例3: updateByCondition
import org.ofbiz.entity.GenericNotImplementedException; //导入依赖的package包/类
public int updateByCondition(ModelEntity modelEntity, Map<String, ? extends Object> fieldsToSet, EntityCondition condition, SQLProcessor sqlP) throws GenericEntityException {
if (modelEntity == null || fieldsToSet == null || condition == null)
return 0;
if (modelEntity instanceof ModelViewEntity) {
throw new org.ofbiz.entity.GenericNotImplementedException("Operation updateByCondition not supported yet for view entities");
}
StringBuilder sql = new StringBuilder("UPDATE ").append(modelEntity.getTableName(datasource));
sql.append(" SET ");
List<EntityConditionParam> params = new LinkedList<EntityConditionParam>();
for (Map.Entry<String, ? extends Object> entry: fieldsToSet.entrySet()) {
String name = entry.getKey();
ModelField field = modelEntity.getField(name);
if (field != null) {
if (!params.isEmpty()) {
sql.append(", ");
}
sql.append(field.getColName()).append(" = ?");
params.add(new EntityConditionParam(field, entry.getValue()));
}
}
sql.append(" WHERE ").append(condition.makeWhereString(modelEntity, params, this.datasource));
try {
sqlP.prepareStatement(sql.toString());
for (EntityConditionParam param: params) {
SqlJdbcUtil.setValue(sqlP, param.getModelField(), modelEntity.getEntityName(), param.getFieldValue(), modelFieldTypeReader);
}
return sqlP.executeUpdate();
} finally {
sqlP.close();
}
}
示例4: getType
import org.ofbiz.entity.GenericNotImplementedException; //导入依赖的package包/类
public static int getType(String fieldType) throws GenericNotImplementedException {
Integer val = fieldTypeMap.get(fieldType);
if (val == null) {
throw new GenericNotImplementedException("Java type " + fieldType + " not currently supported. Sorry.");
}
return val.intValue();
}