Pousse Café - Spring Data MongoDB

Pousse-Café is a framework assisting in writing DDD-based applications

License

License

GroupId

GroupId

org.pousse-cafe-framework
ArtifactId

ArtifactId

pousse-cafe-spring-mongo
Last Version

Last Version

0.18.0
Release Date

Release Date

Type

Type

jar
Description

Description

Pousse Café - Spring Data MongoDB
Pousse-Café is a framework assisting in writing DDD-based applications
Source Code Management

Source Code Management

http://github.com/pousse-cafe/pousse-cafe-spring-mongo

Download pousse-cafe-spring-mongo

How to add to project

<!-- https://jarcasting.com/artifacts/org.pousse-cafe-framework/pousse-cafe-spring-mongo/ -->
<dependency>
    <groupId>org.pousse-cafe-framework</groupId>
    <artifactId>pousse-cafe-spring-mongo</artifactId>
    <version>0.18.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.pousse-cafe-framework/pousse-cafe-spring-mongo/
implementation 'org.pousse-cafe-framework:pousse-cafe-spring-mongo:0.18.0'
// https://jarcasting.com/artifacts/org.pousse-cafe-framework/pousse-cafe-spring-mongo/
implementation ("org.pousse-cafe-framework:pousse-cafe-spring-mongo:0.18.0")
'org.pousse-cafe-framework:pousse-cafe-spring-mongo:jar:0.18.0'
<dependency org="org.pousse-cafe-framework" name="pousse-cafe-spring-mongo" rev="0.18.0">
  <artifact name="pousse-cafe-spring-mongo" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.pousse-cafe-framework', module='pousse-cafe-spring-mongo', version='0.18.0')
)
libraryDependencies += "org.pousse-cafe-framework" % "pousse-cafe-spring-mongo" % "0.18.0"
[org.pousse-cafe-framework/pousse-cafe-spring-mongo "0.18.0"]

Dependencies

provided (3)

Group / Artifact Type Version
org.pousse-cafe-framework : pousse-cafe-core jar 0.28.0
org.pousse-cafe-framework : pousse-cafe-spring jar 0.15.0
org.springframework.data : spring-data-mongodb jar 3.1.3

test (1)

Group / Artifact Type Version
junit : junit jar 4.13.1

Project Modules

There are no modules declared in this project.

Travis build status Maven status

Pousse-Café Spring Mongo

This storage plugin uses Spring Data MongoDB as its backend and is therefore able to store data into a MongoDB database.

EntityAttributes implementations should be annotated like Spring Data MongoDB documents (i.e. using @Document, @Id, etc.).

MongoDataAccess expects subclasses to define mongoRepository method which must return a Spring Data MongoRepository. The convertId method must be defined in order to convert an aggregate's ID into a serializable object. In order to access the MongoRepository, simply autowire it in your data access.

Here is an example of data access implementation:

public class ExampleMongoDataAccess extends MongoDataAccess<ExampleId, ExampleData, String> implements ExampleDataAccess<ProductData> {

    @Override
    protected String convertId(ExampleId id) {
        return ...;
    }

    @Override
    protected MongoRepository<ExampleData, String> mongoRepository() {
        return repository;
    }

    @Autowired
    private ExampleDataMongoRepository repository;

    ...
}

Your Spring configuration class then looks like this (do not forget to include poussecafe.spring in your package scan):

@Configuration
@ComponentScan(basePackages = { "poussecafe.spring" })
public class AppConfiguration {

    @Bean
    public Bundles bundles(
            Messaging messaging,
            SpringMongoDbStorage storage) {
        MessagingAndStorage messagingAndStorage = new MessagingAndStorage(messaging, storage);
        return new Bundles.Builder()
            // Register your bundles here using withBundle and use messagingAndStorage
            // when building them
            .build();
    }
}

Configure your Spring Boot Maven project

Add the following snippet to your POM:

<dependency>
    <groupId>org.pousse-cafe-framework</groupId>
    <artifactId>pousse-cafe-spring-pulsar</artifactId>
    <version>${poussecafe.spring.pulsar.version}</version>
</dependency>
<dependency>
    <groupId>org.apache.pulsar</groupId>
    <artifactId>pulsar-client</artifactId>
    <version>${pulsar.client.version}</version>
</dependency>
org.pousse-cafe-framework

Pousse-Café

Pousse-Café is a framework assisting you in writing applications following Domain Driven Design methodology

Versions

Version
0.18.0
0.17.0
0.16.0
0.15.0
0.14.0
0.13.0
0.12.0
0.11.0
0.10.0
0.9.0
0.8.0
0.7.1
0.7.0
0.6.0
0.5.0
0.4.0
0.3.0
0.2.0