Package org.ofbiz.entity

Examples of org.ofbiz.entity.GenericEntityException


            String pair = tokSemicolon.nextToken();
            StringTokenizer tokColon = new StringTokenizer(pair, ":");

            if (tokColon.countTokens() != 2) {
                // There must be 2 items in the pair separated by colons.
                throw new GenericEntityException(
                    "Each pair to be decoded must have a colon (" +
                    stringToDecode + ")");
            } else {
                String mapKey = tokColon.nextToken();
                String mapValue = tokColon.nextToken();
View Full Code Here


        GenericValue uiQueryGV = delegator.findByPrimaryKey("UiQuery",
                uiQueryFindMap);

        if (uiQueryGV == null) {
            throw new GenericEntityException("No UI Query was found with ID \"" +
                queryId + "\".");
        }

        // Get the query values for this query ID.
        List uiQueryValueL = (List) delegator.getRelated("UiQueryValue",
View Full Code Here

        }

        Vector contentsRow = getContentsRow(row);

        if (contentsRow == null) {
            throw new GenericEntityException("Row " + String.valueOf(row) +
                " does not exist in the data buffer.");
        }

        Iterator gVI = getContentsRow(row).iterator();

        while (gVI.hasNext()) {
            GenericValue testGV = (GenericValue) gVI.next();

            if (testGV.getEntityName().equals(entityName)) {
                if (TIMER) {
                    utilTimer.timerString(5,
                        "[DataBuffer.getGenericValue(row, entityName)] Finished");
                }

                return testGV;
            }
        }

        if (isMandatory) {
            throw new GenericEntityException(
                "No generic value was found with name " + entityName);
        } else {
            return null;
        }
    }
View Full Code Here

                return testEntity;
            }
        }

        throw new GenericEntityException(
            "No generic value found with entity name " + entityName);
    }
View Full Code Here

        String attributeId = getAttributeId();
        UIAttribute uiAttribute = uiCache.getUiAttribute(attributeId);

        if (uiAttribute == null) {
            throw new GenericEntityException("Attribute " + attributeId +
                " does not appear in any of the entities for this screen section.");
        } else {
            if (TIMER) {
                timer.timerString(2,
                    "[UIFieldInfo.UIFieldInfo] Found UIAttribute in cache.");
            }
        }

        setUiAttribute(uiAttribute);

        if (TIMER) {
            timer.timerString(2, "[UIFieldInfo.UIFieldInfo] Got UIAttribute");
        }

        // Get the UIScreenSectionEntity object.
        if (TIMER) {
            timer.timerString(2,
                "[UIFieldInfo.UIFieldInfo] Looking for UIScreenSectionEntity in cache.");
        }

        String sectionId = getSectionId();
        String entityId = getUiAttribute().getEntityId();
        UIScreenSectionEntity uiScreenSectionEntity = uiCache.getUiScreenSectionEntity(sectionId,
                entityId);

        if (uiScreenSectionEntity == null) {

            throw new GenericEntityException("Attribute '" +
                getUiAttribute().getAttributeName() +
                "' does not appear in any of the entities for this screen section.");
        } else {
            if (TIMER) {
                timer.timerString(2,
View Full Code Here

        EntityCondition havingCondition;
        try {
            whereCondition = getWherePlan().getCondition(params);
            havingCondition = getHavingPlan().getCondition(params);
        } catch (ParameterizedConditionException e) {
            throw (GenericEntityException) new GenericEntityException(e.getMessage()).initCause(e);
        }
        return delegator.findListIteratorByCondition(dve, whereCondition, havingCondition, null, orderBy, null);
    }
View Full Code Here

        GenericPK uiDisplayObjectPK = new GenericPK(uiDisplayObjectEntity,
                findMap);
        GenericValue uiDisplayObjectGV = delegator.findByPrimaryKey(uiDisplayObjectPK);

        if (uiDisplayObjectGV == null) {
            throw new GenericEntityException(
                "No display object was found with ID " + displayObjectId);
        }

        setDisplayObjectId(displayObjectId);
        setDisplayTypeId(uiDisplayObjectGV.getString("displayTypeId"));
View Full Code Here

            } catch (RuntimeException e) {
                transactionAbortCause = e;
                throw e;
            } catch (Throwable t) {
                transactionAbortCause = t;
                throw new GenericEntityException(t);
            } finally {
                if (transactionAbortCause == null) {
                    TransactionUtil.commit(tx);
                } else {
                    if (printException) {
View Full Code Here

            int retVal = sqlP.executeUpdate();

            entity.synchronizedWithDatasource();
            return retVal;
        } catch (GenericEntityException e) {
            throw new GenericEntityException("Error while inserting: " + entity.toString(), e);
        } finally {
            sqlP.close();
        }
    }
View Full Code Here

            SqlJdbcUtil.setValues(sqlP, fieldsToSave, entity, modelFieldTypeReader);
            SqlJdbcUtil.setPkValues(sqlP, modelEntity, entity, modelFieldTypeReader);
            retVal = sqlP.executeUpdate();
            entity.synchronizedWithDatasource();
        } catch (GenericEntityException e) {
            throw new GenericEntityException("Error while updating: " + entity.toString(), e);
        } finally {
            sqlP.close();
        }

        if (retVal == 0) {
View Full Code Here

TOP

Related Classes of org.ofbiz.entity.GenericEntityException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.