/** * Insert the given entity into the objects table using the given {@code ps}. * * @param ps the prepared statemtn to use * @param auditLogId the audit log ID associated with the Hive query for this audit log entry * @param category the category of the object * @param entity the entity associated with this query * * @throws EntityException if there's an error processing this entity * @throws SQLException if there's an error inserting into the DB. */ private static void addToObjectsTable( PreparedStatement ps, long auditLogId, ObjectCategory category, Entity entity) throws SQLException, EntityException { int psIndex = 1; ps.setLong(psIndex++, auditLogId); ps.setString(psIndex++, category.toString()); ps.setString(psIndex++, entity.getType().toString()); ps.setString(psIndex++, toIdentifierString(entity)); ps.setString(psIndex, toJson(entity)); ps.executeUpdate(); }
/** * Insert the given entity into the objects table using the given {@code ps}. * * @param ps the prepared statemtn to use * @param auditLogId the audit log ID associated with the Hive query for this audit log entry * @param category the category of the object * @param entity the entity associated with this query * * @throws EntityException if there's an error processing this entity * @throws SQLException if there's an error inserting into the DB. */ private static void addToObjectsTable( PreparedStatement ps, long auditLogId, ObjectCategory category, Entity entity) throws SQLException, EntityException { int psIndex = 1; ps.setLong(psIndex++, auditLogId); ps.setString(psIndex++, category.toString()); ps.setString(psIndex++, entity.getType().toString()); ps.setString(psIndex++, toIdentifierString(entity)); ps.setString(psIndex, toJson(entity)); ps.executeUpdate(); }