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
@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 publicclass 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
; }