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

Update mongo-repository.java.mustache #88

Merged
merged 2 commits into from
Aug 25, 2020
Merged
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ To use the plugin you need Gradle version 5.6 or later, to start add the followi

```groovy
plugins {
id "co.com.bancolombia.cleanArchitecture" version "1.6.7"
id "co.com.bancolombia.cleanArchitecture" version "1.6.8"
}
```

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package=co.com.bancolombia
systemProp.version=1.6.7
systemProp.version=1.6.8

2 changes: 1 addition & 1 deletion src/main/java/co/com/bancolombia/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class Constants {
public static final String SECRETS_VERSION = "2.1.0";
public static final String RCOMMONS_ASYNC_COMMONS_STARTER_VERSION = "0.4.7";
public static final String RCOMMONS_OBJECT_MAPPER_VERSION = "0.1.0";
public static final String PLUGIN_VERSION = "1.6.7";
public static final String PLUGIN_VERSION = "1.6.8";

public enum BooleanOption {
TRUE, FALSE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@ public class JPARepositoryAdapter extends AdapterOperations<Object/* change for
// implements ModelRepository from domain
{

@Autowired
public JPARepositoryAdapter(JPARepository repository, ObjectMapper mapper) {
super(repository, mapper, d -> mapper.map(d, Object.class/* change for domain model */)); // could be mapper.mapBuilder
/**
* Could be use mapper.mapBuilder if your domain model implement builder pattern
* super(repository, mapper, d -> mapper.mapBuilder(d,ObjectModel.ObjectModelBuilder.class).build());
* Or using mapper.map with the class of the object model
*/
super(repository, mapper, d -> mapper.map(d, Object.class/* change for domain model */));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@ public class MongoRepositoryAdapter extends AdapterOperations<Object/* change fo
// implements ModelRepository from domain
{

@Autowired
public MongoRepositoryAdapter(MongoDBRepository repository, ObjectMapper mapper) {
super(repository, mapper, d -> mapper.map(d, Object.class/* change for domain model */)); // could be mapper.mapBuilder
/**
* Could be use mapper.mapBuilder if your domain model implement builder pattern
* super(repository, mapper, d -> mapper.mapBuilder(d,ObjectModel.ObjectModelBuilder.class).build());
* Or using mapper.map with the class of the object model
*/
super(repository, mapper, d -> mapper.map(d, Object.class/* change for domain model */));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ package {{package}}.mongo;
import org.springframework.data.mongodb.repository.ReactiveMongoRepository;
import org.springframework.data.repository.query.ReactiveQueryByExampleExecutor;

interface MongoDBRepository extends ReactiveMongoRepository<Object/* change for adapter model */, String>, ReactiveQueryByExampleExecutor<Object/* change for adapter model */> {
public interface MongoDBRepository extends ReactiveMongoRepository<Object/* change for adapter model */, String>, ReactiveQueryByExampleExecutor<Object/* change for adapter model */> {
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@ public class MongoRepositoryAdapter extends AdapterOperations<Object/* change fo
// implements ModelRepository from domain
{

@Autowired
public MongoRepositoryAdapter(MongoDBRepository repository, ObjectMapper mapper) {
super(repository, mapper, d -> mapper.map(d, Object.class/* change for domain model */)); // could be mapper.mapBuilder
/**
* Could be use mapper.mapBuilder if your domain model implement builder pattern
* super(repository, mapper, d -> mapper.mapBuilder(d,ObjectModel.ObjectModelBuilder.class).build());
* Or using mapper.map with the class of the object model
*/
super(repository, mapper, d -> mapper.map(d, Object.class/* change for domain model */));
}
}