Skip to content

Commit

Permalink
fix reactiveCosmosTemplate bean creating failure (Azure#15789)
Browse files Browse the repository at this point in the history
  • Loading branch information
M authored Sep 29, 2020
1 parent 0196ffd commit 6b259d1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
package com.azure.cosmos;
package com.azure.cosmos.sample;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand All @@ -12,7 +12,6 @@
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

import javax.annotation.PostConstruct;
import java.util.Optional;

@SpringBootApplication
Expand All @@ -28,6 +27,9 @@ public static void main(String[] args) {
}

public void run(String... var1) {
this.repository.deleteAll().block();
LOGGER.info("Deleted all data in container.");

final User testUser = new User("testId", "testFirstName", "testLastName", "test address line one");

// Save the User class to Azure Cosmos DB database.
Expand Down Expand Up @@ -56,10 +58,4 @@ public void run(String... var1) {

LOGGER.info("findOne in User collection get result: {}", result.toString());
}

@PostConstruct
public void setup() {
// For this example, remove all of the existing records.
this.repository.deleteAll().block();
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

package com.azure.cosmos;
package com.azure.cosmos.sample;

import com.azure.spring.data.cosmos.core.mapping.Container;
import com.azure.spring.data.cosmos.core.mapping.PartitionKey;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

package com.azure.cosmos;
package com.azure.cosmos.sample;

import com.azure.spring.data.cosmos.repository.ReactiveCosmosRepository;
import org.springframework.stereotype.Repository;
Expand Down

0 comments on commit 6b259d1

Please sign in to comment.