diff --git a/samples/samples-java/pom.xml b/samples/samples-java/pom.xml index a67444af..5e867946 100644 --- a/samples/samples-java/pom.xml +++ b/samples/samples-java/pom.xml @@ -27,7 +27,7 @@ com.microsoft.azure.functions azure-functions-java-library-sql - 2.0.0-preview + 2.1.0-preview diff --git a/samples/samples-java/src/main/java/com/function/ProductsTriggerLeasesTableName.java b/samples/samples-java/src/main/java/com/function/ProductsTriggerLeasesTableName.java new file mode 100644 index 00000000..59b4a8da --- /dev/null +++ b/samples/samples-java/src/main/java/com/function/ProductsTriggerLeasesTableName.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +package com.function; + +import com.microsoft.azure.functions.ExecutionContext; +import com.microsoft.azure.functions.annotation.FunctionName; +import com.microsoft.azure.functions.sql.annotation.SQLTrigger; +import com.function.Common.SqlChangeProduct; +import com.google.gson.Gson; + +import java.util.logging.Level; + +public class ProductsTriggerLeasesTableName { + @FunctionName("ProductsTriggerLeasesTableName") + public void run( + @SQLTrigger( + name = "changes", + tableName = "[dbo].[Products]", + connectionStringSetting = "SqlConnectionString", + leasesTableName = "Leases") + SqlChangeProduct[] changes, + ExecutionContext context) { + + context.getLogger().log(Level.INFO, "SQL Changes: " + new Gson().toJson(changes)); + } +} \ No newline at end of file diff --git a/test/Integration/SqlTriggerBindingIntegrationTests.cs b/test/Integration/SqlTriggerBindingIntegrationTests.cs index 56f1d6ca..fbbe8f2d 100644 --- a/test/Integration/SqlTriggerBindingIntegrationTests.cs +++ b/test/Integration/SqlTriggerBindingIntegrationTests.cs @@ -811,7 +811,6 @@ void MonitorOutputData(object sender, DataReceivedEventArgs e) /// [Theory] [SqlInlineData()] - [UnsupportedLanguages(SupportedLanguages.Java)] public void LeasesTableNameTest(SupportedLanguages lang) { this.ExecuteNonQuery("DROP TABLE IF EXISTS [az_func].[Leases]"); diff --git a/test/Integration/test-java/pom.xml b/test/Integration/test-java/pom.xml index 67b685e7..3d1b2f83 100644 --- a/test/Integration/test-java/pom.xml +++ b/test/Integration/test-java/pom.xml @@ -27,7 +27,7 @@ com.microsoft.azure.functions azure-functions-java-library-sql - 2.0.0-preview + 2.1.0-preview