Examples of AddFaqErrorException


Examples of com.uwyn.drone.modules.faqmanagement.exceptions.AddFaqErrorException

  {
    if (null == bot)    throw new IllegalArgumentException("bot can't be null.");
    if (null == faqDatathrow new IllegalArgumentException("faqData can't be null.");
    if (!faqData.validate())
    {
      throw new AddFaqErrorException(faqData);
    }
   
    final int[] result = new int[] {-1};

    try
    {
      if (0 == executeUpdate(mAddFaq, new DbPreparedStatementHandler() {
          public DbPreparedStatement getPreparedStatement(Query query, DbConnection connection)
          {
            return connection.getPreparedStatement(query, Statement.RETURN_GENERATED_KEYS);
          }
         
          public void setParameters(DbPreparedStatement statement)
          {
            statement
              .setString("botname", bot.getName())
              .setBean(faqData);
          }
         
          public int performUpdate(DbPreparedStatement statement)
          {
            setParameters(statement);
            int query_result = statement.executeUpdate();
            result[0] = statement.getFirstGeneratedIntKey();
            return query_result;
          }
        }))
      {
        throw new AddFaqErrorException(faqData);
      }
    }
    catch (InnerClassException e)
    {
      throw ((FaqManagerException)e.getCause());
    }
    catch (DatabaseException e)
    {
      throw new AddFaqErrorException(faqData, e);
    }
   
    assert result[0] >= 0;

    return result[0];
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.