diff --git a/AzureCosmosDBJava-DocumentManagement/DocumentDB.Spatial.Sql.dll b/AzureCosmosDBJava-DocumentManagement/DocumentDB.Spatial.Sql.dll new file mode 100644 index 0000000..f1a0ea5 Binary files /dev/null and b/AzureCosmosDBJava-DocumentManagement/DocumentDB.Spatial.Sql.dll differ diff --git a/AzureCosmosDBJava-DocumentManagement/Microsoft.Azure.Documents.ServiceInterop.dll b/AzureCosmosDBJava-DocumentManagement/Microsoft.Azure.Documents.ServiceInterop.dll new file mode 100644 index 0000000..3df189a Binary files /dev/null and b/AzureCosmosDBJava-DocumentManagement/Microsoft.Azure.Documents.ServiceInterop.dll differ diff --git a/AzureCosmosDBJava-DocumentManagement/README.md b/AzureCosmosDBJava-DocumentManagement/README.md new file mode 100644 index 0000000..563b34c --- /dev/null +++ b/AzureCosmosDBJava-DocumentManagement/README.md @@ -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/) + diff --git a/AzureCosmosDBJava-DocumentManagement/bin/DocumentDB.Spatial.Sql.dll b/AzureCosmosDBJava-DocumentManagement/bin/DocumentDB.Spatial.Sql.dll new file mode 100644 index 0000000..f1a0ea5 Binary files /dev/null and b/AzureCosmosDBJava-DocumentManagement/bin/DocumentDB.Spatial.Sql.dll differ diff --git a/AzureCosmosDBJava-DocumentManagement/bin/Microsoft.Azure.Documents.ServiceInterop.dll b/AzureCosmosDBJava-DocumentManagement/bin/Microsoft.Azure.Documents.ServiceInterop.dll new file mode 100644 index 0000000..3df189a Binary files /dev/null and b/AzureCosmosDBJava-DocumentManagement/bin/Microsoft.Azure.Documents.ServiceInterop.dll differ diff --git a/AzureCosmosDBJava-DocumentManagement/bin/README.md b/AzureCosmosDBJava-DocumentManagement/bin/README.md new file mode 100644 index 0000000..563b34c --- /dev/null +++ b/AzureCosmosDBJava-DocumentManagement/bin/README.md @@ -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/) + diff --git a/AzureCosmosDBJava-DocumentManagement/bin/pom.xml b/AzureCosmosDBJava-DocumentManagement/bin/pom.xml new file mode 100644 index 0000000..72fe98a --- /dev/null +++ b/AzureCosmosDBJava-DocumentManagement/bin/pom.xml @@ -0,0 +1,31 @@ + + 4.0.0 + GetStarted + GetStarted + 0.0.1-SNAPSHOT + GetStarted + + src + + + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + + + + + com.microsoft.azure + azure-documentdb + LATEST + + + + 1.8 + 1.8 + + diff --git a/AzureCosmosDBJava-DocumentManagement/bin/src/GetStarted/Address.class b/AzureCosmosDBJava-DocumentManagement/bin/src/GetStarted/Address.class new file mode 100644 index 0000000..f7336ba Binary files /dev/null and b/AzureCosmosDBJava-DocumentManagement/bin/src/GetStarted/Address.class differ diff --git a/AzureCosmosDBJava-DocumentManagement/bin/src/GetStarted/Marks.class b/AzureCosmosDBJava-DocumentManagement/bin/src/GetStarted/Marks.class new file mode 100644 index 0000000..c2fa530 Binary files /dev/null and b/AzureCosmosDBJava-DocumentManagement/bin/src/GetStarted/Marks.class differ diff --git a/AzureCosmosDBJava-DocumentManagement/bin/src/GetStarted/Program.class b/AzureCosmosDBJava-DocumentManagement/bin/src/GetStarted/Program.class new file mode 100644 index 0000000..87a7624 Binary files /dev/null and b/AzureCosmosDBJava-DocumentManagement/bin/src/GetStarted/Program.class differ diff --git a/AzureCosmosDBJava-DocumentManagement/bin/src/GetStarted/School.class b/AzureCosmosDBJava-DocumentManagement/bin/src/GetStarted/School.class new file mode 100644 index 0000000..d2c4961 Binary files /dev/null and b/AzureCosmosDBJava-DocumentManagement/bin/src/GetStarted/School.class differ diff --git a/AzureCosmosDBJava-DocumentManagement/bin/src/GetStarted/Student.class b/AzureCosmosDBJava-DocumentManagement/bin/src/GetStarted/Student.class new file mode 100644 index 0000000..a0b251f Binary files /dev/null and b/AzureCosmosDBJava-DocumentManagement/bin/src/GetStarted/Student.class differ diff --git a/AzureCosmosDBJava-DocumentManagement/bin/src/GetStarted/Teacher.class b/AzureCosmosDBJava-DocumentManagement/bin/src/GetStarted/Teacher.class new file mode 100644 index 0000000..ebca8e4 Binary files /dev/null and b/AzureCosmosDBJava-DocumentManagement/bin/src/GetStarted/Teacher.class differ diff --git a/AzureCosmosDBJava-DocumentManagement/pom.xml b/AzureCosmosDBJava-DocumentManagement/pom.xml new file mode 100644 index 0000000..72fe98a --- /dev/null +++ b/AzureCosmosDBJava-DocumentManagement/pom.xml @@ -0,0 +1,31 @@ + + 4.0.0 + GetStarted + GetStarted + 0.0.1-SNAPSHOT + GetStarted + + src + + + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + + + + + com.microsoft.azure + azure-documentdb + LATEST + + + + 1.8 + 1.8 + + diff --git a/AzureCosmosDBJava-DocumentManagement/src/GetStarted/Address.java b/AzureCosmosDBJava-DocumentManagement/src/GetStarted/Address.java new file mode 100644 index 0000000..9724119 --- /dev/null +++ b/AzureCosmosDBJava-DocumentManagement/src/GetStarted/Address.java @@ -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; +} + diff --git a/AzureCosmosDBJava-DocumentManagement/src/GetStarted/Marks.java b/AzureCosmosDBJava-DocumentManagement/src/GetStarted/Marks.java new file mode 100644 index 0000000..2029e76 --- /dev/null +++ b/AzureCosmosDBJava-DocumentManagement/src/GetStarted/Marks.java @@ -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; +} diff --git a/AzureCosmosDBJava-DocumentManagement/src/GetStarted/Program.java b/AzureCosmosDBJava-DocumentManagement/src/GetStarted/Program.java new file mode 100644 index 0000000..02766db --- /dev/null +++ b/AzureCosmosDBJava-DocumentManagement/src/GetStarted/Program.java @@ -0,0 +1,337 @@ +package GetStarted; + +import java.io.IOException; + +import com.microsoft.azure.documentdb.ConnectionPolicy; +import com.microsoft.azure.documentdb.ConsistencyLevel; +import com.microsoft.azure.documentdb.DataType; +import com.microsoft.azure.documentdb.Database; +import com.microsoft.azure.documentdb.Document; +import com.microsoft.azure.documentdb.DocumentClient; +import com.microsoft.azure.documentdb.DocumentClientException; +import com.microsoft.azure.documentdb.DocumentCollection; +import com.microsoft.azure.documentdb.FeedOptions; +import com.microsoft.azure.documentdb.FeedResponse; +import com.microsoft.azure.documentdb.Index; +import com.microsoft.azure.documentdb.IndexingPolicy; +import com.microsoft.azure.documentdb.RangeIndex; +import com.microsoft.azure.documentdb.RequestOptions; + +public class Program +{ + + private static final RequestOptions options = null; + private DocumentClient client; + + /** + * + * @param args + * command line arguments + * @throws DocumentClientException + * exception + * @throws IOException + */ + public static void main(String[] args) + { + + try + { + Program p = new Program(); + p.getStartedDemo(); + System.out.println(String.format("Demo complete, please hold while resources are deleted")); + } + catch (Exception e) + { + System.out.println(String.format("DocumentDB GetStarted failed with %s", e)); + } + } + + private void getStartedDemo() throws DocumentClientException, IOException + { + //Replace MY_END_POINT and MY_AUTHORIZATION_KEY values with your AzureCosmosDB Document Account + this.client = new DocumentClient("https://samplecosmosdb0128.documents.azure.com:443/", "pjCHLiK1SxJ31PmluEOtPpT2S5KRYg6Ch2s8JeKvJQvhg9NXjq23ciFYWRNVfQaSsJRtn2UHdxZim8oyhD1Cbg==", new ConnectionPolicy(), ConsistencyLevel.Session); + + this.createDatabaseIfNotExists("ExampleDB"); + this.createDocumentCollectionIfNotExists("ExampleDB", "ExampleCollection"); + + School InternationalSchool = getInternationalSchoolDocument(); + this.createExampleDocumentIfNotExists("ExampleDB", "ExampleCollection", InternationalSchool); + + School WorldWideSchool = getWorldWideSchoolDocument(); + this.createExampleDocumentIfNotExists("ExampleDB", "ExampleCollection", WorldWideSchool); + + this.executeSimpleQuery("ExampleDB", "ExampleCollection"); + + this.replaceExampleDocument("ExampleDB", "ExampleCollection", "Hyderabad", WorldWideSchool); + + this.upsertExampleDocument("ExampleDB","ExampleCollection",getInternationalSchoolDocument1()); + + // this.client.deleteDatabase("/dbs/ExampleDB", null); + + this.deleteExampleDocument("ExampleDB", "ExampleCollection","JayaUsha International School"); + + } + + private School getInternationalSchoolDocument1() { + School InternationalSchool1 = new School(); + InternationalSchool1.setId("Bala Sai International School"); + InternationalSchool1.setDistrict("Secunderabad"); + return InternationalSchool1; + } + + + private School getInternationalSchoolDocument() { + School InternationalSchool = new School(); + InternationalSchool.setId("JayaUsha International School"); + InternationalSchool.setLastName("JayaUsha"); + + Teacher teacher1 = new Teacher(); + teacher1.setFirstName("Chebrolu"); + + Teacher teacher2 = new Teacher(); + teacher2.setFirstName("Sunnapu"); + + InternationalSchool.setTeachers(new Teacher[] { teacher1, teacher2 }); + + Student student1 = new Student(); + student1.setFirstName("Harika"); + student1.setGender("female"); + student1.setGrade(5); + + Marks mark1 = new Marks(); + mark1.setGivenSubject("Fluffy"); + + student1.setMarks(new Marks[] { mark1 }); + + InternationalSchool.setDistrict("WA5"); + Address address = new Address(); + address.setCity("Seattle"); + address.setCounty("King"); + address.setState("WA"); + + InternationalSchool.setAddress(address); + InternationalSchool.setRegistered(true); + + return InternationalSchool; + } + + private School getWorldWideSchoolDocument() { + School WorldWideSchool = new School(); + WorldWideSchool.setId("Pandu Public School"); + WorldWideSchool.setLastName("Pandu"); + WorldWideSchool.setDistrict("Rangareddy"); + + Teacher teacher1 = new Teacher(); + teacher1.setLastName("Yakkali"); + teacher1.setFirstName("Madhavi"); + + + Teacher teacher2 = new Teacher(); + teacher2.setLastName("Yakkali"); + teacher2.setFirstName("Raghava"); + + WorldWideSchool.setTeachers(new Teacher[] { teacher1, teacher2 }); + + Student student1 = new Student(); + student1.setFirstName("Bala"); + student1.setLastName("Cheb"); + student1.setGrade(8); + + Marks marks1 = new Marks(); + marks1.setGivenSubject("Java"); + + Marks marks2 = new Marks(); + marks2.setGivenSubject("Shadow"); + + student1.setMarks(new Marks[] { marks1, marks2 }); + + Student student2 = new Student(); + student2.setFirstName("Lisa"); + student2.setLastName("Miller"); + student2.setGrade(1); + student2.setGender("female"); + + WorldWideSchool.setStudents(new Student[] { student1, student2 }); + + Address address = new Address(); + address.setCity("NY"); + address.setCounty("Manhattan"); + address.setState("NY"); + + WorldWideSchool.setAddress(address); + WorldWideSchool.setDistrict("NY23"); + WorldWideSchool.setRegistered(true); + return WorldWideSchool; + } + + private void createDatabaseIfNotExists(String databaseName) throws DocumentClientException, IOException + { + String databaseLink = String.format("/dbs/%s", databaseName); + + // Check to verify a database with the id=ExampleDB does not exist + try + { + this.client.readDatabase(databaseLink, null); + this.writeToConsoleAndPromptToContinue(String.format("Found %s", databaseName)); + } + catch (DocumentClientException de) + { + // If the database does not exist, create a new database + if (de.getStatusCode() == 404) + { + Database database = new Database(); + database.setId(databaseName); + + this.client.createDatabase(database, null); + this.writeToConsoleAndPromptToContinue(String.format("Created %s", databaseName)); + } + else + { + throw de; + } + } + } + + private void createDocumentCollectionIfNotExists(String databaseName, String collectionName) throws IOException, DocumentClientException + { + String databaseLink = String.format("/dbs/%s", databaseName); + String collectionLink = String.format("/dbs/%s/colls/%s", databaseName, collectionName); + + try + { + this.client.readCollection(collectionLink, null); + writeToConsoleAndPromptToContinue(String.format("Found %s", collectionName)); + } + catch (DocumentClientException de) + { + // If the document collection does not exist, create a new collection + if (de.getStatusCode() == 404) + { + DocumentCollection collectionInfo = new DocumentCollection(); + collectionInfo.setId(collectionName); + + // Optionally, you can configure the indexing policy of a collection. + // Here we configure collections for maximum query flexibility including string range queries. + + RangeIndex index = new RangeIndex(DataType.String); + index.setPrecision(-1); + + collectionInfo.setIndexingPolicy(new IndexingPolicy(new Index[] { index })); + + // DocumentDB collections can be reserved with throughput specified in request units/second. + // 1 RU is a normalized request equivalent to the read of a 1KB document. + // Here we create a collection with 400 RU/s. + + RequestOptions requestOptions = new RequestOptions(); + requestOptions.setOfferThroughput(400); + + this.client.createCollection(databaseLink, collectionInfo, requestOptions); + + this.writeToConsoleAndPromptToContinue(String.format("Created %s", collectionName)); + } + else + { + throw de; + } + } + + } + + private void createExampleDocumentIfNotExists(String databaseName, String collectionName, School school) + throws DocumentClientException, IOException { + try { + String documentLink = String.format("/dbs/%s/colls/%s/docs/%s", databaseName, collectionName, school.getId()); + this.client.readDocument(documentLink, new RequestOptions()); + } catch (DocumentClientException de) { + if (de.getStatusCode() == 404) { + String collectionLink = String.format("/dbs/%s/colls/%s", databaseName, collectionName); + this.client.createDocument(collectionLink, school, new RequestOptions(), true); + this.writeToConsoleAndPromptToContinue(String.format("Created School %s", school.getId())); + } else { + throw de; + } + } + } + + private void createExampleDocumentIfNotExistsForUpsert(String databaseName, String collectionName, School school) + throws DocumentClientException, IOException { + try { + String documentLink = String.format("/dbs/%s/colls/%s/docs/%s", databaseName, collectionName, school.getId()); + this.client.readDocument(documentLink, new RequestOptions()); + } catch (DocumentClientException de) { + if (de.getStatusCode() == 404) { + String collectionLink = String.format("/dbs/%s/colls/%s", databaseName, collectionName); + this.client.createDocument(collectionLink, school, new RequestOptions(), true); + this.writeToConsoleAndPromptToContinue(String.format("Created School %s", school.getId())); + } else { + replaceExampleDocument("ExampleDB", "ExampleCollection", "Hyderabad", school); + } + } + } + + private void executeSimpleQuery(String databaseName, String collectionName) { + // Set some common query options + FeedOptions queryOptions = new FeedOptions(); + queryOptions.setPageSize(-1); + queryOptions.setEnableCrossPartitionQuery(true); + + String collectionLink = String.format("/dbs/%s/colls/%s", databaseName, collectionName); + FeedResponse queryResults = this.client.queryDocuments(collectionLink, + "SELECT * FROM School WHERE School.lastName = 'Pandu'", queryOptions); + + // this.client.deleteCollection(collectionName, null) + + System.out.println("Running SQL query..."); + for (Document school : queryResults.getQueryIterable()) { + System.out.println(String.format("\tRead %s", school)); + } + } + + @SuppressWarnings("unused") + private void replaceExampleDocument(String databaseName, String collectionName, String District, School updatedSchool) + throws IOException, DocumentClientException { + try { + updatedSchool.setDistrict("Mavuri"); + this.client.replaceDocument( + String.format("/dbs/%s/colls/%s/docs/%s", databaseName, collectionName, updatedSchool.getId()), updatedSchool, + null); + writeToConsoleAndPromptToContinue(String.format("Replaced School %s", updatedSchool.getId())); + writeToConsoleAndPromptToContinue(String.format("Replaced %s", updatedSchool.getDistrict())); + } catch (DocumentClientException de) { + throw de; + } + } + + private void upsertExampleDocument(String databaseName, String collectionName, School upsertedSchool) + throws IOException, DocumentClientException { + createExampleDocumentIfNotExistsForUpsert("ExampleDB", "ExampleCollection", upsertedSchool); + upsertedSchool.setDistrict("Vijayawada"); + this.client.replaceDocument( + String.format("/dbs/%s/colls/%s/docs/%s", databaseName, collectionName, upsertedSchool.getId()), upsertedSchool, + null); + writeToConsoleAndPromptToContinue(String.format("Upserted School %s", upsertedSchool.getId())); + writeToConsoleAndPromptToContinue(String.format("Upserted %s", upsertedSchool.getDistrict())); + } + + + private void deleteExampleDocument(String databaseName, String collectionName, String documentName) throws IOException, + DocumentClientException { + try { + this.client.deleteDocument(String.format("/dbs/%s/colls/%s/docs/%s", databaseName, collectionName, documentName), null); + this.client.deleteDatabase(String.format("/dbs/%s", databaseName), null); + writeToConsoleAndPromptToContinue(String.format("Deleted School %s", documentName)); + writeToConsoleAndPromptToContinue(String.format("Deleted Database %s", databaseName)); + } catch (DocumentClientException de) { + throw de; + } + } + + + + private void writeToConsoleAndPromptToContinue(String text) throws IOException { + System.out.println(text); + System.out.println("Press any key to continue ..."); + System.in.read(); + } +} + diff --git a/AzureCosmosDBJava-DocumentManagement/src/GetStarted/School.java b/AzureCosmosDBJava-DocumentManagement/src/GetStarted/School.java new file mode 100644 index 0000000..aa14ab3 --- /dev/null +++ b/AzureCosmosDBJava-DocumentManagement/src/GetStarted/School.java @@ -0,0 +1,74 @@ +package GetStarted; + +public class School +{ + public School() + { + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } + + public String getDistrict() { + return district; + } + + public void setDistrict(String district) { + this.district = district; + + } + + public Teacher[] getTeachers() { + return teachers; + } + + public void setTeachers(Teacher[] teachers) { + this.teachers = teachers; + } + + public Student[] getstudents() { + return students; + } + + public void setStudents(Student[] students) { + this.students = students; + } + + public Address getAddress() { + return address; + } + + public void setAddress(Address address) { + this.address = address; + } + + public boolean isRegistered() { + return isRegistered; + } + + public void setRegistered(boolean isRegistered) { + this.isRegistered = isRegistered; + } + + private String id; + private String lastName; + private String district; + private Teacher[] teachers; + private Student[] students; + private Address address; + private boolean isRegistered; + } + diff --git a/AzureCosmosDBJava-DocumentManagement/src/GetStarted/Student.java b/AzureCosmosDBJava-DocumentManagement/src/GetStarted/Student.java new file mode 100644 index 0000000..5118ff1 --- /dev/null +++ b/AzureCosmosDBJava-DocumentManagement/src/GetStarted/Student.java @@ -0,0 +1,50 @@ +package GetStarted; + +public class Student { + public String getLastName() { + return LastName; + } + + public void setLastName(String LastName) { + this.LastName = LastName; + } + + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public String getGender() { + return gender; + } + + public void setGender(String gender) { + this.gender = gender; + } + + public int getGrade() { + return grade; + } + + public void setGrade(int grade) { + this.grade = grade; + } + + public Marks[] getMarks() { + return marks; + } + + public void setMarks(Marks[] marks) { + this.marks = marks; + } + + private String LastName; + private String firstName; + private String gender; + private int grade; + private Marks[] marks; +} + diff --git a/AzureCosmosDBJava-DocumentManagement/src/GetStarted/Teacher.java b/AzureCosmosDBJava-DocumentManagement/src/GetStarted/Teacher.java new file mode 100644 index 0000000..0b63f16 --- /dev/null +++ b/AzureCosmosDBJava-DocumentManagement/src/GetStarted/Teacher.java @@ -0,0 +1,30 @@ +package GetStarted; + +public class Teacher{ + + public Teacher() { + } + + public Teacher(String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return LastName; + } + + public void setLastName(String LastName) { + this.LastName = LastName; + } + + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + private String LastName; + private String firstName; +} diff --git a/AzureCosmosDBJava-DocumentManagement/target/classes/GetStarted/Address.class b/AzureCosmosDBJava-DocumentManagement/target/classes/GetStarted/Address.class new file mode 100644 index 0000000..4f65d54 Binary files /dev/null and b/AzureCosmosDBJava-DocumentManagement/target/classes/GetStarted/Address.class differ diff --git a/AzureCosmosDBJava-DocumentManagement/target/classes/GetStarted/Marks.class b/AzureCosmosDBJava-DocumentManagement/target/classes/GetStarted/Marks.class new file mode 100644 index 0000000..479ef77 Binary files /dev/null and b/AzureCosmosDBJava-DocumentManagement/target/classes/GetStarted/Marks.class differ diff --git a/AzureCosmosDBJava-DocumentManagement/target/classes/GetStarted/Program.class b/AzureCosmosDBJava-DocumentManagement/target/classes/GetStarted/Program.class new file mode 100644 index 0000000..2ec0edc Binary files /dev/null and b/AzureCosmosDBJava-DocumentManagement/target/classes/GetStarted/Program.class differ diff --git a/AzureCosmosDBJava-DocumentManagement/target/classes/GetStarted/School.class b/AzureCosmosDBJava-DocumentManagement/target/classes/GetStarted/School.class new file mode 100644 index 0000000..f0643e7 Binary files /dev/null and b/AzureCosmosDBJava-DocumentManagement/target/classes/GetStarted/School.class differ diff --git a/AzureCosmosDBJava-DocumentManagement/target/classes/GetStarted/Student.class b/AzureCosmosDBJava-DocumentManagement/target/classes/GetStarted/Student.class new file mode 100644 index 0000000..5e148cc Binary files /dev/null and b/AzureCosmosDBJava-DocumentManagement/target/classes/GetStarted/Student.class differ diff --git a/AzureCosmosDBJava-DocumentManagement/target/classes/GetStarted/Teacher.class b/AzureCosmosDBJava-DocumentManagement/target/classes/GetStarted/Teacher.class new file mode 100644 index 0000000..1e7cc92 Binary files /dev/null and b/AzureCosmosDBJava-DocumentManagement/target/classes/GetStarted/Teacher.class differ