All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.microsoft.azure.functions.annotation.TableInput Maven / Gradle / Ivy

Go to download

This package contains all Java interfaces and annotations to interact with Microsoft Azure functions runtime.

The newest version!
/**
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Licensed under the MIT License. See License.txt in the project root for
 * license information.
 */

package com.microsoft.azure.functions.annotation;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * 

Place this on a parameter whose value would come from storage table. * The parameter type can be one of the following:

* *
    *
  • Any native Java types such as int, String, byte[]
  • *
  • Nullable values using Optional<T>
  • *
  • Any POJO type
  • *
* *

The following example shows an HTTP trigger which returned the total count of the items in a table storage:

* *
{@literal @}FunctionName("getallcount")
 * public int run(
 *    {@literal @}HttpTrigger(name = "req",
 *                  methods = {"get"},
 *                  authLevel = AuthorizationLevel.ANONYMOUS) Object dummyShouldNotBeUsed,
 *    {@literal @}TableInput(name = "items",
 *                 tableName = "mytablename",
 *                 partitionKey = "myparkey",
 *                 connection = "myconnvarname") MyItem[] items
 * ) {
 *     return items.length;
 * }
* * @see com.microsoft.azure.functions.annotation.HttpTrigger * @since 1.0.0 */ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.PARAMETER) public @interface TableInput { /** * The variable name used in function.json. * @return The variable name used in function.json. */ String name(); /** *

Defines how Functions runtime should treat the parameter value. Possible values are:

*
    *
  • "": get the value as a string, and try to deserialize to actual parameter type like POJO
  • *
  • string: always get the value as a string
  • *
  • binary: get the value as a binary data, and try to deserialize to actual parameter type byte[]
  • *
* @return The dataType which will be used by the Functions runtime. */ String dataType() default ""; /** * Defines the name of the storage table to which to bind. * @return The storage table name string. */ String tableName(); /** * Defines the partition key of the storage table to which to bind. * @return The storage table partition key string. */ String partitionKey() default ""; /** * Defines the row key of the storage table to which to bind. * @return The storage table row key string. */ String rowKey() default ""; /** * Defines the filter of the storage table to which to bind. * @return The storage table filter string. */ String filter() default ""; /** * Defines the number of rows to be retrieved from the storage table to which to bind. * @return The storage table retrieving rows number string. */ String take() default ""; /** * Defines the app setting name that contains the Azure Storage connection string. * @return The app setting name of the connection string. */ String connection() default ""; }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy