Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document Management-all CRUD operations #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
Binary file not shown.
25 changes: 25 additions & 0 deletions AzureCosmosDBJava-DocumentManagement/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Developing a Java app using Azure Cosmos DB
Azure Cosmos DB is a globally distributed multi-model database. One of the supported APIs is the DocumentDB API, which provides a JSON document model with SQL querying and JavaScript procedural logic. This sample shows you how to use the Azure Cosmos DB with the DocumentDB API to store and access data from a Java application.

## Running this sample

* Before you can run this sample, you must have the following prerequisites:

* An active Azure account. If you don't have one, you can sign up for a [free account](https://azure.microsoft.com/free/). Alternatively, you can use the [Azure Cosmos DB Emulator](https://azure.microsoft.com/documentation/articles/documentdb-nosql-local-emulator) for this tutorial.
* JDK 1.7+ (Run `apt-get install default-jdk` if you don't have JDK)
* Maven (Run `apt-get install maven` if you don't have Maven)

* Next, substitute the endpoint and authorization key in Program.java with your Cosmos DB account's values.

* If Maven dependencies are not added to your project, then you should add it manually in pom.xml file under properties tab using values maven.compiler.source : 1.8 and maven.compiler.target : 1.8.

* From a command prompt or shell, run `mvn package` to compile and resolve dependencies.

* From a command prompt or shell, run `mvn exec:java -D exec.mainClass=GetStarted.Program` to run the application.

## More information
- [Azure Cosmos DB](https://docs.microsoft.com/azure/cosmos-db/introduction)
- [Azure Cosmos DB : DocumentDB API](https://docs.microsoft.com/azure/documentdb/documentdb-introduction)
- [Azure DocumentDB Java SDK](https://docs.microsoft.com/azure/cosmos-db/documentdb-sdk-java)
- [Azure DocumentDB Java SDK Reference Documentation](http://azure.github.io/azure-documentdb-java/)

Binary file not shown.
Binary file not shown.
25 changes: 25 additions & 0 deletions AzureCosmosDBJava-DocumentManagement/bin/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Developing a Java app using Azure Cosmos DB
Azure Cosmos DB is a globally distributed multi-model database. One of the supported APIs is the DocumentDB API, which provides a JSON document model with SQL querying and JavaScript procedural logic. This sample shows you how to use the Azure Cosmos DB with the DocumentDB API to store and access data from a Java application.

## Running this sample

* Before you can run this sample, you must have the following prerequisites:

* An active Azure account. If you don't have one, you can sign up for a [free account](https://azure.microsoft.com/free/). Alternatively, you can use the [Azure Cosmos DB Emulator](https://azure.microsoft.com/documentation/articles/documentdb-nosql-local-emulator) for this tutorial.
* JDK 1.7+ (Run `apt-get install default-jdk` if you don't have JDK)
* Maven (Run `apt-get install maven` if you don't have Maven)

* Next, substitute the endpoint and authorization key in Program.java with your Cosmos DB account's values.

* If Maven dependencies are not added to your project, then you should add it manually in pom.xml file under properties tab using values maven.compiler.source : 1.8 and maven.compiler.target : 1.8.

* From a command prompt or shell, run `mvn package` to compile and resolve dependencies.

* From a command prompt or shell, run `mvn exec:java -D exec.mainClass=GetStarted.Program` to run the application.

## More information
- [Azure Cosmos DB](https://docs.microsoft.com/azure/cosmos-db/introduction)
- [Azure Cosmos DB : DocumentDB API](https://docs.microsoft.com/azure/documentdb/documentdb-introduction)
- [Azure DocumentDB Java SDK](https://docs.microsoft.com/azure/cosmos-db/documentdb-sdk-java)
- [Azure DocumentDB Java SDK Reference Documentation](http://azure.github.io/azure-documentdb-java/)

31 changes: 31 additions & 0 deletions AzureCosmosDBJava-DocumentManagement/bin/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<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">
<modelVersion>4.0.0</modelVersion>
<groupId>GetStarted</groupId>
<artifactId>GetStarted</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>GetStarted</name>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-documentdb</artifactId>
<version>LATEST</version>
</dependency>
</dependencies>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
</project>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
31 changes: 31 additions & 0 deletions AzureCosmosDBJava-DocumentManagement/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<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">
<modelVersion>4.0.0</modelVersion>
<groupId>GetStarted</groupId>
<artifactId>GetStarted</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>GetStarted</name>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-documentdb</artifactId>
<version>LATEST</version>
</dependency>
</dependencies>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
</project>
32 changes: 32 additions & 0 deletions AzureCosmosDBJava-DocumentManagement/src/GetStarted/Address.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package GetStarted;

public class Address {
public String getState() {
return state;
}

public void setState(String state) {
this.state = state;
}

public String getCounty() {
return county;
}

public void setCounty(String county) {
this.county = county;
}

public String getCity() {
return city;
}

public void setCity(String city) {
this.city = city;
}

private String state;
private String county;
private String city;
}

13 changes: 13 additions & 0 deletions AzureCosmosDBJava-DocumentManagement/src/GetStarted/Marks.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package GetStarted;

public class Marks {
public String getSubject() {
return givenSubject;
}

public void setGivenSubject(String givenSubject) {
this.givenSubject = givenSubject;
}

private String givenSubject;
}
Loading