Class TruncateTableCommand

java.lang.Object
org.labkey.remoteapi.Command<ResponseType,org.apache.hc.client5.http.classic.methods.HttpPost>
org.labkey.remoteapi.PostCommand<TruncateTableResponse>
org.labkey.remoteapi.query.TruncateTableCommand
All Implemented Interfaces:
HasRequiredVersion

public class TruncateTableCommand extends PostCommand<TruncateTableResponse>
Command for truncating a table from a read-write schema. The user associated with the connection used when executing this command must have permission to delete the data.
  • Constructor Details

    • TruncateTableCommand

      public TruncateTableCommand(String schemaName, String queryName)
      Constructs a TruncateTableCommand for the given schemaName and queryName.
      Parameters:
      schemaName - The schemaName
      queryName - The queryName
  • Method Details

    • getSchemaName

      public String getSchemaName()
      Returns the schema name.
      Returns:
      The schema name.
    • setSchemaName

      public void setSchemaName(String schemaName)
      Sets the schema name
      Parameters:
      schemaName - The new schema name.
    • getQueryName

      public String getQueryName()
      Returns the query name
      Returns:
      the query name.
    • setQueryName

      public void setQueryName(String queryName)
      Sets a new query name to update
      Parameters:
      queryName - the query name.
    • createResponse

      protected TruncateTableResponse createResponse(String text, int status, String contentType, org.json.JSONObject json)
      Description copied from class: Command
      Creates an instance of the response class, initialized with the response text, the HTTP status code, and parsed JSONObject.

      Override this method to create an instance of a different class that extends CommandResponse

      Overrides:
      createResponse in class Command<TruncateTableResponse,org.apache.hc.client5.http.classic.methods.HttpPost>
      Parameters:
      text - The response text from the server.
      status - The HTTP status code.
      contentType - The Content-Type header value.
      json - The parsed JSONObject (or null if no JSON was returned).
      Returns:
      An instance of the response object.
    • getJsonObject

      public org.json.JSONObject getJsonObject()
      Description copied from class: PostCommand
      Returns the JSON object to post or null for no JSON. Override this method to provide parameters as JSON.
      Overrides:
      getJsonObject in class PostCommand<TruncateTableResponse>
      Returns:
      The JSON object to post.