Skip to content

Commit

Permalink
Initial import
Browse files Browse the repository at this point in the history
  • Loading branch information
aduursma committed Dec 25, 2017
1 parent 6c4f74b commit 474e110
Show file tree
Hide file tree
Showing 4 changed files with 128 additions and 1 deletion.
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,18 @@
# commons-repository-mongodb
# Commons Repository MongoDB

![badge-version](https://img.shields.io/badge/Version-v1.0.0-green.svg)

## Introduction
This Maven module contains Spring Data REST utility classes for working with MongoDB repositories.


## Usage
Include the following in the _dependencies_ section of the Maven POM of the Maven module you want
to use the classes in:

<dependency>
<groupId>nl.agility.commons</groupId>
<artifactId>commons-repository-mongodb</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>

50 changes: 50 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>nl.agility.maven</groupId>
<artifactId>parent-pom</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>

<groupId>nl.agility.commons</groupId>
<artifactId>commons-repository-mongodb</artifactId>
<version>1.0.0-${revision}</version>

<name>Agility IT Services - Commons Repository MongoDB</name>
<description>The Agility IT Services' Commons Repository MongoDB</description>

<scm>
<url>https://github.com/aduursma/commons-repository-mongodb</url>
<connection>scm:git:git://github.com/aduursma/commons-repository-mongodb.git</connection>
<developerConnection>scm:git:[email protected]:aduursma/commons-repository-mongodb.git</developerConnection>
</scm>

<properties>
<revision>SNAPSHOT</revision>
<fongo.version>2.1.0</fongo.version>
</properties>

<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-mongodb</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-rest</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.github.fakemongo</groupId>
<artifactId>fongo</artifactId>
<version>${fongo.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
16 changes: 16 additions & 0 deletions src/changes/changes.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<document xmlns="http://maven.apache.org/changes/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/changes/1.0.0 http://maven.apache.org/xsd/changes-1.0.0.xsd">

<properties>
<title>Release notes</title>
</properties>

<body>
<release version="1.0.0" description="Initial release">
<action type="add" dev="aduursma" date="25-12-2017">
Added initial project setup.
</action>
</release>
</body>
</document>
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package nl.agility.commons.repository.mongodb;

import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.data.repository.NoRepositoryBean;
import org.springframework.data.rest.core.annotation.RestResource;

import java.io.Serializable;
import java.util.List;

@NoRepositoryBean
public interface ReadOnlyMongoDbRepository<T, ID extends Serializable> extends MongoRepository<T, ID> {

@Override
@RestResource(exported = false)
<S extends T> List<S> save(Iterable<S> entites);

@Override
@RestResource(exported = false)
<S extends T> S insert(S entity);

@Override
@RestResource(exported = false)
<S extends T> List<S> insert(Iterable<S> entities);

@Override
@RestResource(exported = false)
<S extends T> S save(S entity);

@Override
@RestResource(exported = false)
void delete(ID id);

@Override
@RestResource(exported = false)
void delete(T entity);

@Override
@RestResource(exported = false)
void delete(Iterable<? extends T> entities);

@Override
@RestResource(exported = false)
void deleteAll();
}

0 comments on commit 474e110

Please sign in to comment.