Nano Banana Pro
Agent skill for nano-banana-pro
MongOCOM (Mongo Object-COllection Mapper) is a lightweight Java Object-Document Mapping (ODM) library for MongoDB. It provides an annotation-based approach to map Java objects to MongoDB documents, similar to how JPA/Hibernate works for relational databases.
Sign in to like and favorite skills
MongOCOM (Mongo Object-COllection Mapper) is a lightweight Java Object-Document Mapping (ODM) library for MongoDB. It provides an annotation-based approach to map Java objects to MongoDB documents, similar to how JPA/Hibernate works for relational databases.
@Document, @ObjectId, @Internal, @Reference)CollectionManager# Clone the repository git clone https://github.com/devops-thiago/MongOCOM.git cd MongOCOM # Build the project mvn clean compile # Run tests mvn test # Run all quality checks ./check-quality.sh
The main entry point for database operations:
CollectionManagerFactory - Factory for creating CollectionManager instancesCollectionManager - Handles CRUD operations and object mappingCloseable@Document(collection="name") - Marks a class as a MongoDB document@ObjectId - Marks a field as the MongoDB _id field@Internal - Marks embedded objects that should be stored within parent document@Reference - Marks relationships to separate documents@Index - Defines indexes on fields (for optimization)database.properties in classpathWEB-INF/conf/CollectionManager instances to free resources# Check code formatting mvn spotless:check # Fix formatting issues mvn spotless:apply # Run static analysis mvn checkstyle:check pmd:check spotbugs:check # Generate coverage report mvn test jacoco:report
src/test/javacom.arquivolivre.mongocom.annotation packageCollectionManagerCollectionManager class@Document(collection = "users") public class User { @ObjectId private String id; private String name; private String email; @Internal private Address address; // Embedded document @Reference private List<Order> orders; // Referenced documents // Default constructor required public User() {} // Getters and setters... }
// Properties file approach CollectionManager cm = CollectionManagerFactory.setup(); // Programmatic approach CollectionManager cm = CollectionManagerFactory .createCollectionManager("localhost", 27017, "myapp"); // With authentication CollectionManager cm = CollectionManagerFactory .createCollectionManager("localhost", 27017, "myapp", "user", "pass");
mvn compile - Compile source codemvn test - Run unit tests with coveragemvn package - Create JAR filemvn verify - Run all quality checksmvn clean - Clean build artifactspom.xml./check-quality.shmongo-java-driver - MongoDB Java driverjavax.javaee-web-api - Java EE web API for servlet supportjunit - Testing frameworkmvn spotless:apply to fix./check-quality.shThis project is prepared for migration to Java 17:
When migrating: