private Long getDataStoreId(Class<?> modelClass) throws MetaException {
    ExecutionContext ec = ((JDOPersistenceManager) pm).getExecutionContext();
    AbstractClassMetaData cmd = ec.getMetaDataManager().getMetaDataForClass(modelClass, ec.getClassLoaderResolver());
    if (cmd.getIdentityType() == IdentityType.DATASTORE) {
      return (Long) ec.getStoreManager().getValueGenerationStrategyValue(ec, cmd, null);
    } else {
      throw new MetaException("Identity type is not datastore.");
    }
  }
Interface to execute multiple row insert query in batch for direct SQL
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/DirectSqlInsertPart.java