{"id":16971794,"url":"https://github.com/pnowy/nativecriteria","last_synced_at":"2025-06-27T13:38:21.444Z","repository":{"id":6872897,"uuid":"8121949","full_name":"pnowy/NativeCriteria","owner":"pnowy","description":"Ultra lightweight lib to generate dynamic SQL based on hibernate session","archived":false,"fork":false,"pushed_at":"2024-03-10T18:38:03.000Z","size":5897,"stargazers_count":36,"open_issues_count":20,"forks_count":10,"subscribers_count":5,"default_branch":"develop","last_synced_at":"2025-04-02T05:42:36.308Z","etag":null,"topics":["dynamic-sql","hibernate","java","jpa","native-criteria","sql"],"latest_commit_sha":null,"homepage":"http://nativecriteria.przemeknowak.com","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"telstra/2015-Uni-Challenge","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pnowy.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-02-10T11:42:50.000Z","updated_at":"2024-08-02T05:45:18.000Z","dependencies_parsed_at":"2024-03-10T19:49:36.926Z","dependency_job_id":null,"html_url":"https://github.com/pnowy/NativeCriteria","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/pnowy/NativeCriteria","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pnowy%2FNativeCriteria","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pnowy%2FNativeCriteria/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pnowy%2FNativeCriteria/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pnowy%2FNativeCriteria/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pnowy","download_url":"https://codeload.github.com/pnowy/NativeCriteria/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pnowy%2FNativeCriteria/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262266711,"owners_count":23284747,"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":["dynamic-sql","hibernate","java","jpa","native-criteria","sql"],"created_at":"2024-10-14T00:54:45.652Z","updated_at":"2025-06-27T13:38:21.421Z","avatar_url":"https://github.com/pnowy.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n![](https://github.com/pnowy/NativeCriteria/workflows/ci/badge.svg)\n![](https://github.com/pnowy/NativeCriteria/workflows/documentation/badge.svg)\n[![Maven Central](https://img.shields.io/maven-central/v/org.apache.maven/apache-maven.svg)](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.github.pnowy.nc%22)\n\n### Development \u0026\u0026 Participation\n\nIf you want to participate on the development please perform the pull request to the **develop** branch.\n\n### Documentation\n\nDocumentation is available on [http://nativecriteria.przemeknowak.com/](http://nativecriteria.przemeknowak.com/)\n\n### Library available on Maven Central Repository\n```xml\n\u003c!-- core module --\u003e\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.github.pnowy.nc\u003c/groupId\u003e\n    \u003cartifactId\u003enativeCriteria-core\u003c/artifactId\u003e\n    \u003cversion\u003e3.2.0\u003c/version\u003e\n\u003c/dependency\u003e\n\n\u003c!-- spring integration module --\u003e\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.github.pnowy.nc\u003c/groupId\u003e\n    \u003cartifactId\u003enativeCriteria-spring\u003c/artifactId\u003e\n    \u003cversion\u003e3.2.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n### Simple example:\n```java\n// SELECT a.city FROM address a WHERE a.zip_code IS NULL AND city := ? ORDER BY a.city ASC\nNativeCriteria nc = new NativeCriteria(new JpaQueryProvider(entityManager), \"address\", \"a\")\n      .setProjection(NativeExps.projection().addProjection(\"a.city\"))                       \n      .add(NativeExps.isNull(\"a.zip_code\"));                                                \n      .setOrder(NativeExps.order().add(\"a.city\", OrderType.ASC));\n\n// dynamic where part\nif (StringUtils.isNotEmpty(city)) {\n    nc.add(NativeExps.eq(\"a.city\", city))\n}            \n      \n// get the results\nCriteriaResult res = c.criteriaResult();                                                    \nList\u003cString\u003e cityNames = new ArrayList\u003c\u003e();\nwhile (res.next()) {                                                                        \n   resp.add(res.getString(\"a.city\"));                                                       \n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpnowy%2Fnativecriteria","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpnowy%2Fnativecriteria","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpnowy%2Fnativecriteria/lists"}