Package org.hivedb

Examples of org.hivedb.HiveRuntimeException


    if (!hive.directory().doesPrimaryIndexKeyExist(config.getPrimaryIndexKey(entity)))
      try {
        hive.directory().insertPrimaryIndexKey(config.getPrimaryIndexKey(entity));
      } catch (HiveLockableException e) {
        throw new HiveRuntimeException(e.getMessage(), e);
      }

    Collection<Integer> nodeIds =
      hive.directory().getNodeIdsOfPrimaryIndexKey(config.getPrimaryIndexKey(entity));
View Full Code Here


    Session session = null;
    try {
      session = factory.openSession();
      return session.connection().getMetaData().getURL();
    } catch (SQLException e) {
      throw new HiveRuntimeException(e);
    } finally {
      if(session != null)
        session.close();
    }
  }
View Full Code Here

        new int[] {Types.VARCHAR,Types.INTEGER,Types.VARCHAR,Types.BIT});
    creatorFactory.setReturnGeneratedKeys(true);
    int rows = j.update(creatorFactory
        .newPreparedStatementCreator(parameters), generatedKey);
    if (rows != 1)
      throw new HiveRuntimeException("Unable to create Resource: "
          + parameters);
    if (generatedKey.getKeyList().size() == 0)
      throw new HiveRuntimeException("Unable to retrieve generated primary key");
    newResource.updateId(generatedKey.getKey().intValue());
   
    // dependencies
    for (SecondaryIndex si : newResource.getSecondaryIndexes())
      new SecondaryIndexDao(ds).create(si);
View Full Code Here

        new int[] {Types.VARCHAR,Types.INTEGER,Types.VARCHAR,Types.INTEGER,Types.BIT});
    creatorFactory.setReturnGeneratedKeys(true);
    int rows = j.update(creatorFactory
        .newPreparedStatementCreator(parameters), generatedKey);
    if (rows != 1)
      throw new HiveRuntimeException("Unable to update Resource: " + resource.getId());
   
    // dependencies
    for (SecondaryIndex si : resource.getSecondaryIndexes())
      new SecondaryIndexDao(ds).update(si);
  }
View Full Code Here

        "DELETE FROM resource_metadata WHERE id=?",
        new int[] { Types.INTEGER });
    int rows = j.update(creatorFactory
        .newPreparedStatementCreator(parameters));
    if (rows != 1)
      throw new HiveRuntimeException("Unable to delete resource for id: " + resource.getId());
  }
View Full Code Here

        new int[] { Types.INTEGER, Types.VARCHAR, Types.VARCHAR });
    creatorFactory.setReturnGeneratedKeys(true);
    int rows = j.update(creatorFactory
        .newPreparedStatementCreator(parameters), generatedKey);
    if (rows != 1)
      throw new HiveRuntimeException("Unable to create secondary index: "
          + parameters);
    if (generatedKey.getKeyList().size() == 0)
      throw new HiveRuntimeException("Unable to retrieve generated primary key");
    newObject.updateId(generatedKey.getKey().intValue());
 
    return new Integer(newObject.getId());
  }
View Full Code Here

        new int[] { Types.INTEGER, Types.VARCHAR, Types.VARCHAR, Types.INTEGER });
    creatorFactory.setReturnGeneratedKeys(true);
    int rows = j.update(creatorFactory
        .newPreparedStatementCreator(parameters), generatedKey);
    if (rows != 1)
      throw new HiveRuntimeException("Unable to update secondary index: " + secondaryIndex.getId());
  }
View Full Code Here

        "DELETE FROM secondary_index_metadata WHERE id=?",
        new int[] { Types.INTEGER });
    int rows = j.update(creatorFactory
        .newPreparedStatementCreator(parameters));
    if (rows != 1)
      throw new HiveRuntimeException("Unable to delete secondary index for id: " + secondaryIndex.getId());
  }
View Full Code Here

        Transform.map(new Unary<Object, String>() {
          public String f(Object item) {
            return item != null ? config.getId(item).toString() : "null";
          }
        }, collection));
      throw new HiveRuntimeException(String.format("Encountered null items in collection: %s", ids));
    }
  }
View Full Code Here

      new int[]{Types.VARCHAR, Types.VARCHAR, Types.VARCHAR});
    creatorFactory.setReturnGeneratedKeys(true);
    int rows = j.update(creatorFactory
      .newPreparedStatementCreator(parameters), generatedKey);
    if (rows != 1)
      throw new HiveRuntimeException("Unable to create Partition Dimension: " + parameters);
    if (generatedKey.getKeyList().size() == 0)
      throw new HiveRuntimeException("Unable to retrieve generated primary key");
    newObject.updateId(generatedKey.getKey().intValue());

    // dependencies
    for (Resource r : newObject.getResources())
      new ResourceDao(getDataSource()).create(r);
View Full Code Here

TOP

Related Classes of org.hivedb.HiveRuntimeException

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.