{"id":15043995,"url":"https://github.com/ug-dbg/yop","last_synced_at":"2026-01-02T01:18:53.646Z","repository":{"id":57742365,"uuid":"125025360","full_name":"ug-dbg/yop","owner":"ug-dbg","description":"YOP is a lightweight ORM wannabe. Hit and run, no session, no bytecode generation, SQL-like syntax with method references.","archived":false,"fork":false,"pushed_at":"2019-04-23T09:07:47.000Z","size":3294,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-06T12:06:16.171Z","etag":null,"topics":["crud","java","java-8","lightweight","orm","yop"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ug-dbg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-03-13T09:26:18.000Z","updated_at":"2019-04-23T09:07:49.000Z","dependencies_parsed_at":"2022-09-09T11:21:15.011Z","dependency_job_id":null,"html_url":"https://github.com/ug-dbg/yop","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ug-dbg%2Fyop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ug-dbg%2Fyop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ug-dbg%2Fyop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ug-dbg%2Fyop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ug-dbg","download_url":"https://codeload.github.com/ug-dbg/yop/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243451605,"owners_count":20293168,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["crud","java","java-8","lightweight","orm","yop"],"created_at":"2024-09-24T20:49:56.034Z","updated_at":"2026-01-02T01:18:53.616Z","avatar_url":"https://github.com/ug-dbg.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# YOP !\n\nYOP is an **[ORM](https://en.wikipedia.org/wiki/Object-relational_mapping \"Wikipedia → ORM\") tool**.  \nAnd since I am such a nice guy, a [REST](https://en.wikipedia.org/wiki/Representational_state_transfer \"Wikipedia → REST\") stack is built on top of it.\n\n## Status\n[![Build Status](http://hdmcl.no-ip.org:8081/job/yop-test-MySQL/badge/icon)](http://jenkins.y-op.org/job/yop-test-MySQL/)  \n  \nModules : \n- [![Coverage](http://hdmcl.no-ip.org:8081/job/yop-test-MySQL/ws/reflection/target/jacoco.svg)](http://jenkins.y-op.org/job/yop-test-MySQL/lastBuild/jacoco) \n[reflection](reflection/README.md \"The reflection module README\")\n- [![Coverage](http://hdmcl.no-ip.org:8081/job/yop-test-MySQL/ws/orm/target/jacoco.svg)](http://jenkins.y-op.org/job/yop-test-MySQL/lastBuild/jacoco)\n[orm](orm/README.md \"The orm module README\")\n- [![Coverage](http://hdmcl.no-ip.org:8081/job/yop-test-MySQL/ws/ioc/target/jacoco.svg)](http://jenkins.y-op.org/job/yop-test-MySQL/lastBuild/jacoco)\n[ioc](ioc/README.md \"The ioc module README\")\n- [![Coverage](http://hdmcl.no-ip.org:8081/job/yop-test-MySQL/ws/rest/target/jacoco.svg)](http://jenkins.y-op.org/job/yop-test-MySQL/lastBuild/jacoco)\n[rest](rest/README.md \"The rest module README\")\n- [![Coverage](http://hdmcl.no-ip.org:8081/job/yop-test-MySQL/ws/swaggerui/target/jacoco.svg)](http://jenkins.y-op.org/job/yop-test-MySQL/lastBuild/jacoco)\n[swaggerui](swaggerui/README.md \"The swaggerui module README\")\n- [demo](demo/README.md \"The demo module README\")\n  \n## Maven\nYop modules are available on Maven central :  \n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003eorg.y-op\u003c/groupId\u003e\n    \u003cartifactId\u003ereflection\u003c/artifactId\u003e\n    \u003cversion\u003e0.9.0\u003c/version\u003e\n\u003c/dependency\u003e\n```  \n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003eorg.y-op\u003c/groupId\u003e\n    \u003cartifactId\u003eioc\u003c/artifactId\u003e\n    \u003cversion\u003e0.9.0\u003c/version\u003e\n\u003c/dependency\u003e\n```  \n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003eorg.y-op\u003c/groupId\u003e\n    \u003cartifactId\u003eorm\u003c/artifactId\u003e\n    \u003cversion\u003e0.9.0\u003c/version\u003e\n\u003c/dependency\u003e\n```  \n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003eorg.y-op\u003c/groupId\u003e\n    \u003cartifactId\u003erest\u003c/artifactId\u003e\n    \u003cversion\u003e0.9.0\u003c/version\u003e\n\u003c/dependency\u003e\n```  \n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003eorg.y-op\u003c/groupId\u003e\n    \u003cartifactId\u003eswaggerui\u003c/artifactId\u003e\n    \u003cversion\u003e0.9.0\u003c/version\u003e\n\u003c/dependency\u003e\n```  \n  \n## About\nYop is an **ORM tool** with a conventional REST webservice Servlet.\nWebservices are described using \n[OpenAPI specifications](https://en.wikipedia.org/wiki/OpenAPI_Specification \"Wikipedia → OpenAPI specification\")\n\n## Structure :  \nThe [ORM](orm) module brings a set of query builders with an SQL like syntax : \n\n```\nSelect   \n .from(Library.class)    \n .join(Library::getAuthors, Author::getBooks, Book::getChapters)    \n .join(Library::getEmployees)  \n .execute(connection);\n  ```\n  \nThe [REST](rest) module brings a set of annotations to directly expose the data objects as REST resources : \n```\n@Rest(\n  path=\"book\",\n  summary = \"Rest resource for books !\",\n  description = \"A collection of sheets of paper bound together to hinge at one edge.\"\n)\n@Table(name=\"book\")\npublic class Book implements Yopable {}\n``` \n\nA REST servlet can expose the data objects as REST resources : \n```\nWrapper wrapper = Tomcat.addServlet(context, YopRestServlet.class.getSimpleName(), new YopRestServlet());\n\n// The data objects packages exposed as REST resources\nwrapper.addInitParameter(YopRestServlet.PACKAGE_INIT_PARAM, \"org.yop\");\n\n// The datasource JNDI name (or you can override the 'getConnection' method)\nwrapper.addInitParameter(YopRestServlet.DATASOURCE_JNDI_INIT_PARAM, \"datasource\");\n\n// The exposition path for the data objects REST resources\ncontext.addServletMappingDecoded(\"/yop/rest/*\", YopRestServletWithConnection.class.getSimpleName());\n```\n\nThe [OpenAPI](https://www.openapis.org/ \"Open API initiative\") description of data objects can be generated\nand exposed using a Servlet : \n```\nWrapper wrapper = Tomcat.addServlet(context, OpenAPIServlet.class.getSimpleName(), new OpenAPIServlet());\n\n// The data objects packages exposed as REST resources\nwrapper.addInitParameter(OpenAPIServlet.PACKAGE_INIT_PARAM, \"org.yop\");\n\n// The exposition path for the data objects REST resources\nwrapper.addInitParameter(OpenAPIServlet.EXPOSITION_PATH_PARAM, \"/yop/rest\");\n\n// The exposition path for the generated OpenAPI description of the data objects REST resources\ncontext.addServletMappingDecoded(\"/yop/openapi\", OpenAPIServlet.class.getSimpleName());\n```\n\n## Miscellaneous / Philosophy\n- Data objects describe their REST and/or ORM features.  \n- CRUD behavior in REST services is conventional.  \n- Data objects carry any extra CRUD behavior (i.e beyond conventional) to be exposed in REST services.  \n- Explicit CRUD can be achieved using the orm module in an SQL like syntax.  \n- [DAO pattern](https://en.wikipedia.org/wiki/Data_access_object \"Wikipedia → DAO\") sucks.  \n- [DTO pattern](https://en.wikipedia.org/wiki/Data_transfer_object \"Wikipedia → DTO\") sucks.  \n- YOP naively aims at being a straightforward **Model-Driven ORM/REST** stack.  ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fug-dbg%2Fyop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fug-dbg%2Fyop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fug-dbg%2Fyop/lists"}