{"id":13805373,"url":"https://github.com/avrilfanomar/flexiblesearchbuilder","last_synced_at":"2026-01-14T02:29:43.697Z","repository":{"id":57738861,"uuid":"174969569","full_name":"avrilfanomar/flexiblesearchbuilder","owner":"avrilfanomar","description":"Flexible search query builder is SAP Hybris Commerce extension (released as a library) that provides developer-friendly way to build flexible search queries. The aim of this extension is to write().flexibleSearchQueries().easily() in compile-time safe manner without a need to remember the syntax.","archived":false,"fork":false,"pushed_at":"2025-05-28T08:12:08.000Z","size":126,"stargazers_count":19,"open_issues_count":2,"forks_count":5,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-05-28T09:26:31.511Z","etag":null,"topics":["builder-pattern","commerce-cloud","flexible-search","hybris","hybris-commerce","hybris-commerce-suite","hybris-extension","sap-commerce","sap-hybris"],"latest_commit_sha":null,"homepage":"","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/avrilfanomar.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":"2019-03-11T09:41:55.000Z","updated_at":"2025-05-28T08:12:12.000Z","dependencies_parsed_at":"2022-08-24T17:40:15.913Z","dependency_job_id":null,"html_url":"https://github.com/avrilfanomar/flexiblesearchbuilder","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/avrilfanomar/flexiblesearchbuilder","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avrilfanomar%2Fflexiblesearchbuilder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avrilfanomar%2Fflexiblesearchbuilder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avrilfanomar%2Fflexiblesearchbuilder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avrilfanomar%2Fflexiblesearchbuilder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/avrilfanomar","download_url":"https://codeload.github.com/avrilfanomar/flexiblesearchbuilder/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avrilfanomar%2Fflexiblesearchbuilder/sbom","scorecard":{"id":218609,"data":{"date":"2025-08-11","repo":{"name":"github.com/avrilfanomar/flexiblesearchbuilder","commit":"56279901c2f9b506caf615d6b9a74a12da48d0bb"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.6,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"1 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact 3.2.0 not signed: https://api.github.com/repos/avrilfanomar/flexiblesearchbuilder/releases/36320696","Warn: release artifact 3.2.0 does not have provenance: https://api.github.com/repos/avrilfanomar/flexiblesearchbuilder/releases/36320696"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-17T02:05:45.147Z","repository_id":57738861,"created_at":"2025-08-17T02:05:45.147Z","updated_at":"2025-08-17T02:05:45.147Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28408711,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T01:52:23.358Z","status":"online","status_checked_at":"2026-01-14T02:00:06.678Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["builder-pattern","commerce-cloud","flexible-search","hybris","hybris-commerce","hybris-commerce-suite","hybris-extension","sap-commerce","sap-hybris"],"created_at":"2024-08-04T01:01:00.528Z","updated_at":"2026-01-14T02:29:43.692Z","avatar_url":"https://github.com/avrilfanomar.png","language":"Java","funding_links":[],"categories":["SAP Commerce Resources"],"sub_categories":["GitHub"],"readme":"# Flexible search query builder\n\nFlexible search query builder is SAP Hybris Commerce extension (released as a library) that provides developer-friendly way to build flexible search queries.\nThe aim of this extension is to `write().flexibleSearchQueries().easily()` with the help of IDE in a compile-time safe manner.\n\n## Installation\n\nIt is released as a Java library.\nYou can find jars at https://bitbucket.org/andriichukandrii/flexiblesearchbuilder/downloads/\nIt is now also possible to use following Maven dependency:\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003eorg.bitbucket.andriichukandrii\u003c/groupId\u003e\n    \u003cartifactId\u003eflexiblesearchbuilder\u003c/artifactId\u003e\n    \u003cversion\u003e3.2.2\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nFor development purposes it can be added as an extension either to localextensions.xml or to other extension dependencies.\n\n## Usage\n\nAll the elements of the builder chain are immutable (unless you pass a mutable parameter and then modify it), \nthus they can be safely reused among different queries.\n\nHere are some examples of using the flexible search query builder (executable in groovy scripting console)\n```java\nimport static de.hybris.platform.core.model.order.AbstractOrderEntryModel.ORDER;\nimport static de.hybris.platform.core.model.order.AbstractOrderEntryModel.PRODUCT;\nimport static de.hybris.platform.core.model.order.AbstractOrderModel.USER;\n\nimport static org.bitbucket.andriichukandrii.hybris.flexiblesearchbuilder.Conditions.braces;\nimport static org.bitbucket.andriichukandrii.hybris.flexiblesearchbuilder.Conditions.condition;\nimport static org.bitbucket.andriichukandrii.hybris.flexiblesearchbuilder.FlexibleSearchQueryBuilder.select;\nimport static org.bitbucket.andriichukandrii.hybris.flexiblesearchbuilder.FlexibleSearchQueryBuilder.selectFrom;\nimport static org.bitbucket.andriichukandrii.hybris.flexiblesearchbuilder.FromClauseElements.table;\nimport static org.bitbucket.andriichukandrii.hybris.flexiblesearchbuilder.ParameterlessConditionType.IS_NOT_NULL;\nimport static org.bitbucket.andriichukandrii.hybris.flexiblesearchbuilder.ParameterlessConditionType.IS_NULL;\nimport static org.bitbucket.andriichukandrii.hybris.flexiblesearchbuilder.TwoParameterConditionType.BETWEEN;\nimport static org.bitbucket.andriichukandrii.hybris.flexiblesearchbuilder.RegularParameterConditionType.IS_EQUAL_TO;\nimport static org.bitbucket.andriichukandrii.hybris.flexiblesearchbuilder.RegularParameterConditionType.IS_GREATER_THAN;\nimport static org.bitbucket.andriichukandrii.hybris.flexiblesearchbuilder.RegularParameterConditionType.LIKE;\nimport static org.bitbucket.andriichukandrii.hybris.flexiblesearchbuilder.SqlFunctions.count;\n\nimport de.hybris.platform.catalog.model.CatalogUnawareMediaModel;\nimport de.hybris.platform.catalog.model.ProductReferenceModel;\nimport de.hybris.platform.category.constants.CategoryConstants;\nimport de.hybris.platform.category.model.CategoryModel;\nimport de.hybris.platform.core.model.order.OrderEntryModel;\nimport de.hybris.platform.core.model.order.OrderModel;\nimport de.hybris.platform.core.model.product.ProductModel;\nimport de.hybris.platform.core.model.user.UserModel;\nimport de.hybris.platform.servicelayer.search.FlexibleSearchQuery;\nimport de.hybris.platform.variants.model.VariantProductModel;\n\nimport org.bitbucket.andriichukandrii.hybris.flexiblesearchbuilder.AbstractFieldCondition;\nimport org.bitbucket.andriichukandrii.hybris.flexiblesearchbuilder.Alias;\nimport org.bitbucket.andriichukandrii.hybris.flexiblesearchbuilder.FieldWithType;\nimport org.bitbucket.andriichukandrii.hybris.flexiblesearchbuilder.FunctionWithType;\nimport org.bitbucket.andriichukandrii.hybris.flexiblesearchbuilder.JoinOnElement;\n\n\nfinal FlexibleSearchQuery query1 = \n    selectFrom(CatalogUnawareMediaModel.class)\n    .where(\n        condition(CatalogUnawareMediaModel.CODE, IS_EQUAL_TO, \"someLogoCode\"))\n    .build();\n\nfinal AbstractFieldCondition nameAndDescriptionNonNull = \n    condition(ProductModel.NAME, IS_NOT_NULL)\n    .and()\n    .condition(ProductModel.DESCRIPTION, IS_NOT_NULL);\n\nfinal FlexibleSearchQuery query2 =\n    selectFrom(ProductModel.class)\n    .where(\n        condition(ProductModel.CODE, LIKE, \"p%\")\n        .and()\n        .condition(nameAndDescriptionNonNull)\n    )\n    .orderByAsc(ProductModel.NAME)\n    .build();\n\nfinal Alias p = new Alias(\"p\");\nfinal Alias v = new Alias(\"v\");\nfinal FlexibleSearchQuery query3 =\n    select(p)\n    .from(\n        table(ProductModel.class).as(p)\n        join(VariantProductModel.class).as(v)\n            .on(p.pk(), IS_EQUAL_TO, v.field(VariantProductModel.BASEPRODUCT))\n    )\n    .where(\n        condition(v.field(VariantProductModel.OFFLINEDATE), IS_GREATER_THAN, timeService.getCurrentTime())\n    )\n    .build();\n\nfinal FlexibleSearchQuery query4 =\n    select(\n        FieldWithType.of(ProductModel.NAME, String.class),\n        FieldWithType.of(ProductModel.DESCRIPTION, String.class),\n        FieldWithType.of(ProductModel.PK, Long.class)\n    )\n    .from(\n        table(ProductModel.class)\n    )\n    .where(\n        braces(\n            condition(ProductModel.SUMMARY, IS_NULL)\n            .or()\n            .condition(ProductModel.NAME, IS_NOT_NULL)\n        )\n        .and()\n        .condition(ProductModel.PK, BETWEEN, 8796093054977L, 8796193054977L)\n    )\n    .build();\n\nfinal UserModel user = userService.getAnonymousUser();\nfinal CategoryModel category = new CategoryModel();//just for demonstration purposes\n\nfinal Alias r = new Alias(\"r\");\nfinal Alias e = new Alias(\"e\");\nfinal Alias o = new Alias(\"o\");\nfinal Alias c2p = new Alias(\"c2p\");\nfinal Alias c = new Alias(\"c\");\n\nfinal JoinOnElement joinTables =\n    table(ProductModel.class).as(p)\n    .leftJoin(ProductReferenceModel.class).as(r)\n        .on(p.pk(), r.target())\n    .leftJoin(OrderEntryModel.class).as(e)\n        .on(r.source(), e.field(PRODUCT))\n    .leftJoin(OrderModel.class).as(o)\n        .on(o.pk(), e.field(ORDER))\n    .leftJoin(CategoryConstants.Relations.CATEGORYPRODUCTRELATION).as(c2p)\n        .on(r.source(), c2p.target())\n    .leftJoin(CategoryModel.class).as(c)\n        .on(c.pk(), c2p.source());\n\nfinal FlexibleSearchQuery query5 =\n    select(p)\n    .from(joinTables)\n    .where(\n        condition(o.field(USER), IS_EQUAL_TO, user)\n        .and()\n        .condition(c.pk(), IS_EQUAL_TO, category)\n    )\n    .orderByAsc(p.field(ProductModel.CODE))\n    .build();\n\nfinal FlexibleSearchQuery query6 = \n    select(\n        FunctionWithType.of(count(o.field(OrderModel.CODE)), Long.class),\n        FieldWithType.of(p.field(ProductModel.CODE), String.class)\n    )\n    .from(\n        table(ProductModel.class).as(p)\n        .join(OrderEntryModel.class).as(e)\n            .on(p.pk(), e.field(OrderEntryModel.PRODUCT))\n        .join(OrderModel.class).as(o)\n            .on(o.pk(), e.field(OrderEntryModel.ORDER))\n    )\n    .groupBy(p.field(ProductModel.CODE))\n    .orderByDesc(count(o.field(OrderModel.CODE)))\n    .build();\n\n```\n\n## Contributing\nPull requests are welcome. If you're planning to contribute, drop me a [mail](mailto:92jo5eqfy@mozmail.com) as currently the process is not formal yet.\n\n## License\n[MIT](https://choosealicense.com/licenses/mit/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favrilfanomar%2Fflexiblesearchbuilder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Favrilfanomar%2Fflexiblesearchbuilder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favrilfanomar%2Fflexiblesearchbuilder/lists"}