Skip to content

Commit

Permalink
Merge pull request #6 from AzureCosmosDB/auto-20241106201451
Browse files Browse the repository at this point in the history
[AUTO] 2024-11-06 | Merge latest from source repo
  • Loading branch information
2 parents 234f428 + 513779f commit 0d647e0
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 4 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
application.properties
33 changes: 33 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
HELP.md
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/

### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/

### VS Code ###
.vscode/
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@
@EnableCosmosRepositories
public class CosmosConfiguration extends AbstractCosmosConfiguration {

@Value("#{environment.AZURE_COSMOS_DB_NOSQL_ENDPOINT}")
private String uri;
@Value("${CONFIGURATION__AZURECOSMOSDB__ENDPOINT}")
private String endpoint;

@Value("${CONFIGURATION__AZURECOSMOSDB__DATABASENAME}")
private String databaseName;

@Bean
public CosmosClientBuilder getCosmosClientBuilder() {
Expand All @@ -34,6 +37,6 @@ public CosmosConfig cosmosConfig() {

@Override
protected String getDatabaseName() {
return "cosmicworks";
return databaseName != null ? databaseName : "cosmicworks";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;

@Container(containerName = "products", autoCreateContainer = false)
@Container(containerName = "${CONFIGURATION__AZURECOSMOSDB__CONTAINERNAME}", autoCreateContainer = false)
public class Item {
private String id;
private String name;
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
application.properties

0 comments on commit 0d647e0

Please sign in to comment.