@Override public void setAutoCommit(final boolean autoCommit) { try { con.setAutoCommit(autoCommit); } catch (SQLException ex) { throw new DataAccessException(ex); } }
private Connection borrowConnection() { try { return ofBizConnectionFactory.getConnection(); } catch (SQLException ex) { throw new DataAccessException(ex); } }
public boolean isCaseSensitive(final String fieldName) { try { return iterator.isCaseSensitive(fieldName); } catch (final GenericEntityException e) { throw new DataAccessException(e); } }
public GenericValue currentGenericValue() { try { return iterator.currentGenericValue(); } catch (final GenericEntityException e) { throw new DataAccessException(e); } }
public List<GenericValue> findByAnd(final String entityName, final List<EntityCondition> expressions) throws DataAccessException { // cannot check EntityCondition instances as they don't give us a where condition try { return delegatorInterface.findByAnd(entityName, expressions); } catch (final GenericEntityException e) { throw new DataAccessException(e); } }
public void removeAll(final List<GenericValue> genericValues) throws DataAccessException { try { delegatorInterface.removeAll(genericValues, false); } catch (final GenericEntityException e) { throw new DataAccessException(e); } }
public int removeByAnd(final String entityName, final Map map) throws DataAccessException { try { return delegatorInterface.removeByAnd(entityName, map); } catch (final GenericEntityException e) { throw new DataAccessException(e); } }
public int removeValue(final GenericValue value) throws DataAccessException { try { return delegatorInterface.removeValue(value); } catch (final GenericEntityException e) { throw new DataAccessException(e); } }
public boolean last() { try { return iterator.last(); } catch (final GenericEntityException e) { throw new DataAccessException(e); } }
private Connection borrowConnection() { try { return ofBizConnectionFactory.getConnection(); } catch (SQLException ex) { throw new DataAccessException(ex); } }
private List<ColumnLayoutItem> removeUnavailableColumnLayoutItemsForUser(final List<ColumnLayoutItem> columnLayoutItems, final ApplicationUser user) { try { return newArrayList(filter(columnLayoutItems, new IsAvailableFieldPredicate(fieldManager.getAvailableNavigableFields(user)))); } catch (FieldException e) { throw new DataAccessException("Could not retrieve available fields.", e); } }
public List<GenericValue> findByAnd(final String entityName, final Map<String, ?> fields, final List<String> orderBy) throws DataAccessException { findByValidator.checkAll(entityName, fields.keySet()); try { return delegatorInterface.findByAnd(entityName, fields, orderBy); } catch (final GenericEntityException e) { throw new DataAccessException(e); } }
@VisibleForTesting GenericValue getSchemeForProject(final GenericValue project) { try { return EntityUtil.getOnly(getSchemes(project)); } catch (GenericEntityException e) { throw new DataAccessException(e); } }
public void collect(Document d) { Issue issue = issueFactory.getIssue(d); try { writeIssue(issue, writer); } catch (IOException e) { throw new DataAccessException(e); } }
public void storeIssueTypes(List<GenericValue> issueTypes) throws DataAccessException { try { ofBizDelegator.storeAll(issueTypes); } catch (DataAccessException e) { throw new DataAccessException("Error occurred while storing issue types to the database.", e); } refreshIssueTypes(); }
public CustomField getCustomField() { // Load the custom field statically.... hmmm... final CustomField customField = ComponentAccessor.getCustomFieldManager().getCustomFieldObject(fieldId); if (customField == null) { throw new DataAccessException("No custom field for " + fieldId + ". This should not happen. Data is likely to be corrupt."); } return customField; }
@Override public Scheme createSchemeObject(final String name, final String description) { try { return schemeFactory.getScheme(createScheme(name, description)); } catch (GenericEntityException e) { throw new DataAccessException(e); } }
@Override public void addDefaultSchemeToProject(final Project project) throws DataAccessException { try { addDefaultSchemeToProject(project.getGenericValue()); } catch (GenericEntityException e) { throw new DataAccessException(e); } }
public List<ColumnLayoutItem> getAllVisibleColumnLayoutItems(final ApplicationUser user) { try { final Set<NavigableField> availableFields = getFieldManager().getAvailableNavigableFieldsWithScope(user); return getVisibleColumnLayoutItems(availableFields); } catch (FieldException e) { throw new DataAccessException(e); } }
@Override public void update(DraftState state, GenericValue schemeGv) { Long parentId = schemeGv.getLong(SchemeTable.Columns.PARENT); if (parentId == null || !parentId.equals(state.getParentSchemeId())) { throw new DataAccessException("Trying to change the parent of a draft."); } schemeGv.set(SchemeTable.Columns.UPDATED_DATE, currentDate()); schemeGv.set(SchemeTable.Columns.UPDATED_USER, state.getLastModifiedUser()); delegator.store(schemeGv); }