Package org.springframework.dao

Examples of org.springframework.dao.DataRetrievalFailureException


  protected final Record createInputRecord(RecordFactory recordFactory, Object inObject) {
    try {
      return new CommAreaRecord(objectToBytes(inObject));
    }
    catch (IOException ex) {
      throw new DataRetrievalFailureException("I/O exception during bytes conversion", ex);
    }
  }
View Full Code Here


    CommAreaRecord commAreaRecord = (CommAreaRecord) record;
    try {
      return bytesToObject(commAreaRecord.toByteArray());
    }
    catch (IOException ex) {
      throw new DataRetrievalFailureException("I/O exception during bytes conversion", ex);
    }
  }
View Full Code Here

        Validate.notNull(portletDefinitionId, "portletDefinitionId can not be null");
        Validate.notNull(channelSubscribeId, "channelSubscribeId can not be null");
       
        final IPortletDefinition portletDefinition = this.portletDefinitionDao.getPortletDefinition(portletDefinitionId);
        if (portletDefinition == null) {
            throw new DataRetrievalFailureException("No IPortletDefinition exists for IPortletDefinitionId='" + portletDefinitionId + "'");
        }
       
        IPortletEntity portletEntity = new PortletEntityImpl(portletDefinition, channelSubscribeId, userId);
       
        this.entityManager.persist(portletEntity);
View Full Code Here

            portletApplicationId = this.servletContext.getContextPath();
        }
        else {
            final IChannelParameter portletApplicaitonIdParam = channelDefinition.getParameter(IPortletAdaptor.CHANNEL_PARAM__PORTLET_APPLICATION_ID);
            if (portletApplicaitonIdParam == null) {
                throw new DataRetrievalFailureException("The specified ChannelDefinition does not provide the needed channel parameter '" + IPortletAdaptor.CHANNEL_PARAM__PORTLET_APPLICATION_ID + "'. ChannelDefinition=" + channelDefinition);
            }
           
            portletApplicationId = portletApplicaitonIdParam.getValue();
        }
       
        final IChannelParameter portletNameParam = channelDefinition.getParameter(IPortletAdaptor.CHANNEL_PARAM__PORTLET_NAME);
        if (portletNameParam == null) {
            throw new DataRetrievalFailureException("The specified ChannelDefinition does not provide the needed channel parameter '" + IPortletAdaptor.CHANNEL_PARAM__PORTLET_NAME + "'. ChannelDefinition=" + channelDefinition);
        }
        final String portletName = portletNameParam.getValue();
       
        return new Tuple<String, String>(portletApplicationId, portletName);
    }
View Full Code Here

        final IChannelDefinition channelDefinition;
        try {
            channelDefinition = this.channelRegistryStore.getChannelDefinition(fName);
        }
        catch (Exception e) {
            throw new DataRetrievalFailureException("Failed to retrieve ChannelDefinition for fName='" + fName + "'", e);
        }
       
        //The channel definition for the fName MUST exist for this class to function
        if (channelDefinition == null) {
            throw new EmptyResultDataAccessException("No ChannelDefinition exists for fName='" + fName + "'", 1);
View Full Code Here

                pd.getName() + "' of type " + pd.getPropertyType());
          }
          bw.setPropertyValue(pd.getName(), value);
        }
        catch (NotWritablePropertyException ex) {
          throw new DataRetrievalFailureException(
              "Unable to map column " + column + " to property " + pd.getName(), ex);
        }
      }
    }
View Full Code Here

                    " of type " + fieldMeta.getJavaType());
              }
              bw.setPropertyValue(fieldMeta.getFieldName(), value);
            }
            catch (NotWritablePropertyException ex) {
              throw new DataRetrievalFailureException("Unable to map column " + column + " to property " + fieldMeta.getFieldName(), ex);             
            }
          }
          else {
            if (rowNumber == 0)
            {
View Full Code Here

          if (populatedProperties != null) {
            populatedProperties.add(pd.getName());
          }
        }
        catch (NotWritablePropertyException ex) {
          throw new DataRetrievalFailureException(
              "Unable to map column " + column + " to property " + pd.getName(), ex);
        }
      }
    }
View Full Code Here

    }
    Iterator keyIter = ((Map) this.keyList.get(0)).values().iterator();
    if (keyIter.hasNext()) {
      Object key = keyIter.next();
      if (!(key instanceof Number)) {
        throw new DataRetrievalFailureException(
            "The generated key is not of a supported numeric type. " +
            "Unable to cast [" + (key != null ? key.getClass().getName() : null) +
            "] to [" + Number.class.getName() + "]");
      }
      return (Number) key;
    }
    else {
      throw new DataRetrievalFailureException("Unable to retrieve the generated key. " +
          "Check that the table has an identity column enabled.");
    }
  }
View Full Code Here

        Element element = null;

        try {
            element = cache.get(serviceTicket);
        } catch (CacheException cacheException) {
            throw new DataRetrievalFailureException("Cache failure: " + cacheException.getMessage());
        }

        if (logger.isDebugEnabled()) {
            logger.debug("Cache hit: " + (element != null) + "; service ticket: " + serviceTicket);
        }
View Full Code Here

TOP

Related Classes of org.springframework.dao.DataRetrievalFailureException

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.