en2do (MongoDB Framework | Easy-To-Use | Async)
2.3.3Mongodb entity database framework with support for asynchronous operations
en2do is short for "Entity-To-Document" .
Are you tired doing the same value mapping task for java classes every time you operate with your mongodb database?
Don't worry! en2do is here to help! The biggest pro of en2do is automatic class mapping to mongodb documents using the mongodb pojo codec, which supports even records from the newest java releases.
It's an entity framework for MongoDB 6.0 in Java 11 - 17, heavily inspired by the popular spring-framework and their spring-data library.
But it has a tone of features, besides automatic mapping
- Creating filter methods without implementing them
- Dynamic and Static sorting using a parameter or annotations
- Pagination on the database to reduce application resources
- Annotations to create new indexes on multiple fields
- Automatic deletion after a specific time (time-to-live indexes)
- Transforming/Renaming field and method names
- Ignoring fields in entities, which shouldn't be saved to the database
For further information see
- Visit en2do on Github
- Found a bug? Open an issue
- Contribute by opening a Pull-Request
- Download the latest version
- Read the JavaDocs
How does it work?
1. Add it as dependency:
repositories {
maven {
name 'koboo-reposilite'
url 'https://reposilite.koboo.eu/releases'
}
}
dependencies {
implementation 'eu.koboo:en2do:2.2.0'
}
2. Create the MongoManager:
public class Application {
public static void main(String[] args) {
MongoManager manager = new MongoManager();
}
}
3. Create an Entity
mport eu.koboo.en2do.annotation.*;
import lombok.*;
import java.util.*;
@Getter // from lombok - required (to access fields)
@Setter // from lombok - required (to change fields)
@NoArgsConstructor // from lombok - required (for mongodb, to create instances)
@FieldDefaults(level = AccessLevel.PRIVATE) // from lombok - optional
@ToString // from lombok
public class Customer {
// from en2do - unique identifier (can be String, int, long, UUID or any object)
// this will also create an index on this field to speed up queries on the unique identifier
@Id
UUID uniqueId;
int customerId;
String firstName;
String lastName;
String birthday;
String street;
int houseNumber;
Integer postalCode;
String city;
Long phoneNumber;
double balance;
List<Order> orders;
}
4. Create the Repository:
import eu.koboo.en2do.*;
import java.util.*;
@Collection("customer_repository")
public interface CustomerRepository extends Repository<Customer, UUID> {
}
5. Packing all together:
public class Application {
public static void main(String[] args) {
MongoManager manager = new MongoManager();
CustomerRepository repository = manager.create(CustomerRepository.class);
}
}
Similar projects
Plugin →Let Me Despawn
Improves performance by tweaking mob despawn rules. Say bye to pesky unintentional persistent mobs.
25MSueta
JourneyMap
Real-time map used for mapping in-game or your browser as you explore.
14.7MSueta
Emotecraft
Create your own emotes in Minecraft.
7.5MSueta
Simple Tpa
A simple tpa plugin which sends requests
5.4MSueta
Common Network
Forge and Fabric Unified Networking Solution
3.9MSueta
Set Home
A lightweight plugin for players to set their homes.
3.8MSueta