Skip to content

Commit 8bdf54a

Browse files
authored
add sql binding java annotations (#379)
1 parent 02888af commit 8bdf54a

File tree

3 files changed

+191
-0
lines changed

3 files changed

+191
-0
lines changed

java-library/pom.xml

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
5+
<groupId>com.microsoft.azure.functions</groupId>
6+
<artifactId>azure-functions-java-library-sql</artifactId>
7+
<version>0.0.0</version>
8+
<packaging>jar</packaging>
9+
10+
<parent>
11+
<groupId>com.microsoft.maven</groupId>
12+
<artifactId>java-8-parent</artifactId>
13+
<version>8.0.1</version>
14+
</parent>
15+
16+
<name>Microsoft Azure Functions Java SQL Types</name>
17+
<description>This package contains all Java annotations to interact with Microsoft Azure Functions runtime for SQL Bindings.</description>
18+
<url>https://aka.ms/sqlbindings</url>
19+
<organization>
20+
<name>Microsoft Azure</name>
21+
<url>https://azure.microsoft.com</url>
22+
</organization>
23+
24+
<properties>
25+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
26+
</properties>
27+
28+
<licenses>
29+
<license>
30+
<name>MIT License</name>
31+
<url>https://opensource.org/licenses/MIT</url>
32+
<distribution>repo</distribution>
33+
</license>
34+
</licenses>
35+
36+
<scm>
37+
<connection>scm:git:https://github.com/Azure/azure-functions-sql-extension</connection>
38+
<developerConnection>scm:git:git@github.com:Azure/azure-functions-sql-extension</developerConnection>
39+
<url>https://github.com/Azure/azure-functions-sql-extension</url>
40+
<tag>HEAD</tag>
41+
</scm>
42+
43+
<developers>
44+
<developer>
45+
<id>LucyZhang</id>
46+
<name>Lucy Zhang</name>
47+
<email>luczhan@microsoft.com</email>
48+
</developer>
49+
</developers>
50+
51+
<distributionManagement>
52+
<snapshotRepository>
53+
<id>ossrh</id>
54+
<name>Sonatype Snapshots</name>
55+
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
56+
<uniqueVersion>true</uniqueVersion>
57+
<layout>default</layout>
58+
</snapshotRepository>
59+
</distributionManagement>
60+
61+
<repositories>
62+
<repository>
63+
<id>maven.snapshots</id>
64+
<name>Maven Central Snapshot Repository</name>
65+
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
66+
<releases>
67+
<enabled>false</enabled>
68+
</releases>
69+
<snapshots>
70+
<enabled>true</enabled>
71+
</snapshots>
72+
</repository>
73+
</repositories>
74+
75+
<dependencies>
76+
<dependency>
77+
<groupId>com.microsoft.azure.functions</groupId>
78+
<artifactId>azure-functions-java-library</artifactId>
79+
<version>1.4.2</version>
80+
</dependency>
81+
</dependencies>
82+
83+
<build>
84+
<plugins>
85+
<plugin>
86+
<artifactId>maven-compiler-plugin</artifactId>
87+
<version>${maven-compiler.version}</version>
88+
</plugin>
89+
<plugin>
90+
<groupId>org.apache.maven.plugins</groupId>
91+
<artifactId>maven-source-plugin</artifactId>
92+
<version>${maven-source.version}</version>
93+
<executions>
94+
<execution>
95+
<id>attach-sources</id>
96+
<goals>
97+
<goal>jar</goal>
98+
</goals>
99+
</execution>
100+
</executions>
101+
</plugin>
102+
<plugin>
103+
<groupId>org.apache.maven.plugins</groupId>
104+
<artifactId>maven-javadoc-plugin</artifactId>
105+
<version>${maven-javadoc.version}</version>
106+
<configuration>
107+
<doclint>none</doclint>
108+
</configuration>
109+
<executions>
110+
<execution>
111+
<id>attach-javadocs</id>
112+
<goals>
113+
<goal>jar</goal>
114+
</goals>
115+
</execution>
116+
</executions>
117+
</plugin>
118+
</plugins>
119+
</build>
120+
</project>
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/**
2+
* Copyright (c) Microsoft Corporation. All rights reserved.
3+
* Licensed under the MIT License. See License.txt in the project root for
4+
* license information.
5+
*/
6+
7+
package com.microsoft.azure.functions.sql.annotation;
8+
9+
import java.lang.annotation.Retention;
10+
import java.lang.annotation.Target;
11+
import java.lang.annotation.RetentionPolicy;
12+
import java.lang.annotation.ElementType;
13+
14+
import com.microsoft.azure.functions.annotation.CustomBinding;
15+
16+
@Retention(RetentionPolicy.RUNTIME)
17+
@Target(ElementType.PARAMETER)
18+
@CustomBinding(direction = "in", name = "sql", type = "sql")
19+
public @interface SQLInput {
20+
/**
21+
* Query string or name of stored procedure to be run.
22+
*/
23+
String commandText() default "";
24+
25+
/**
26+
* Text or Stored Procedure.
27+
*/
28+
String commandType() default "";
29+
30+
/**
31+
* Parameters to the query or stored procedure. This string must follow the format
32+
* "@param1=param1,@param2=param2" where @param1 is the name of the parameter and
33+
* param1 is the parameter value.
34+
*/
35+
String parameters() default "";
36+
37+
/**
38+
* Setting name for SQL connection string.
39+
*/
40+
String connectionStringSetting() default "";
41+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/**
2+
* Copyright (c) Microsoft Corporation. All rights reserved.
3+
* Licensed under the MIT License. See License.txt in the project root for
4+
* license information.
5+
*/
6+
7+
package com.microsoft.azure.functions.sql.annotation;
8+
9+
import java.lang.annotation.Retention;
10+
import java.lang.annotation.Target;
11+
import java.lang.annotation.RetentionPolicy;
12+
import java.lang.annotation.ElementType;
13+
14+
import com.microsoft.azure.functions.annotation.CustomBinding;
15+
16+
17+
@Retention(RetentionPolicy.RUNTIME)
18+
@Target({ ElementType.PARAMETER, ElementType.METHOD })
19+
@CustomBinding(direction = "out", name = "sql", type = "sql")
20+
public @interface SQLOutput {
21+
/**
22+
* Name of the table to upsert data to.
23+
*/
24+
String commandText() default "";
25+
26+
/**
27+
* Setting name for SQL connection string.
28+
*/
29+
String connectionStringSetting() default "";
30+
}

0 commit comments

Comments
 (0)