en2do (MongoDB Framework | Easy-To-Use | Async) icon

en2do (MongoDB Framework | Easy-To-Use | Async) -----

Mongodb 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

How does it work?

1. Add it as dependency:
Code (Kotlin):
repositories {
    maven {
        name 'koboo-reposilite'
        url 'https://reposilite.koboo.eu/releases'
    }
}

dependencies {
    implementation 'eu.koboo:en2do:2.2.0'
}
2. Create the MongoManager:

Code (Java):
public class Application {

    public static void main ( String [ ] args ) {
        MongoManager manager = new MongoManager ( ) ;
    }
}
3. Create an Entity
Code (Java):
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:
Code (Java):
import eu.koboo.en2do.* ;

import java.util.* ;

@ Collection ( "customer_repository" )
public interface CustomerRepository extends Repository <Customer, UUID > {

}
5. Packing all together:
Code (Java):
public class Application {

    public static void main ( String [ ] args ) {
        MongoManager manager = new MongoManager ( ) ;
        CustomerRepository repository = manager. create (CustomerRepository. class ) ;
    }
}


Resource Icon Source
Resource Information
Author:
----------
Total Downloads: 300
First Release: Dec 16, 2022
Last Update: Feb 15, 2023
Category: ---------------
All-Time Rating:
2 ratings
Version -----
Released: --------------------
Downloads: ------
Version Rating:
----------------------
-- ratings