{"id":18842425,"url":"https://github.com/omnifaces/optimusfaces","last_synced_at":"2025-08-20T08:32:05.826Z","repository":{"id":56700149,"uuid":"75930121","full_name":"omnifaces/optimusfaces","owner":"omnifaces","description":"Utility library for OmniFaces + PrimeFaces combined","archived":false,"fork":false,"pushed_at":"2025-07-26T19:31:21.000Z","size":614,"stargazers_count":43,"open_issues_count":2,"forks_count":10,"subscribers_count":15,"default_branch":"develop","last_synced_at":"2025-07-26T23:39:20.271Z","etag":null,"topics":["jpa","jsf","omnifaces","primefaces"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/omnifaces.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"license.txt","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,"zenodo":null}},"created_at":"2016-12-08T11:05:02.000Z","updated_at":"2024-12-16T15:35:38.000Z","dependencies_parsed_at":"2025-01-24T14:27:54.591Z","dependency_job_id":"4e1232ee-372b-4add-8cdf-b05ec27da1dd","html_url":"https://github.com/omnifaces/optimusfaces","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/omnifaces/optimusfaces","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omnifaces%2Foptimusfaces","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omnifaces%2Foptimusfaces/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omnifaces%2Foptimusfaces/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omnifaces%2Foptimusfaces/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/omnifaces","download_url":"https://codeload.github.com/omnifaces/optimusfaces/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omnifaces%2Foptimusfaces/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271287663,"owners_count":24733432,"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","status":"online","status_checked_at":"2025-08-20T02:00:09.606Z","response_time":69,"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":["jpa","jsf","omnifaces","primefaces"],"created_at":"2024-11-08T02:54:41.892Z","updated_at":"2025-08-20T08:32:05.512Z","avatar_url":"https://github.com/omnifaces.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Maven](https://img.shields.io/maven-metadata/v/https/repo.maven.apache.org/maven2/org/omnifaces/optimusfaces/maven-metadata.xml.svg)](https://repo.maven.apache.org/maven2/org/omnifaces/optimusfaces/)\n[![Javadoc](https://javadoc.io/badge/org.omnifaces/optimusfaces.svg)](https://javadoc.io/doc/org.omnifaces/optimusfaces) \n[![Tests](https://github.com/omnifaces/optimusfaces/actions/workflows/maven.yml/badge.svg)](https://github.com/omnifaces/optimusfaces/actions)\n[![License](https://img.shields.io/:license-apache-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0.html)\n\n# OptimusFaces\n\nUtility library for OmniFaces + PrimeFaces combined.\n\n\n## This project is currently still in development stage!\n\nThis project basically combines best of [OmniFaces](http://omnifaces.org/) and [PrimeFaces](http://www.primefaces.org/) with help of [OmniPersistence](https://github.com/omnifaces/omnipersistence), an utility library for JPA. This project should make it a breeze to create semi-dynamic lazy-loaded, searchable, sortable and filterable `\u003cp:dataTable\u003e` based on a JPA model and a generic entity service.\n\n\n### Installation\n\n`pom.xml`\n\n```XML\n\u003cdependencies\u003e\n    \u003c!-- Target Java EE server. --\u003e\n    \u003cdependency\u003e\n        \u003cgroupId\u003ejavax\u003c/groupId\u003e\n        \u003cartifactId\u003ejavaee-api\u003c/artifactId\u003e\n        \u003cversion\u003e8.0\u003c/version\u003e\u003c!-- Minimum supported version is 7.0 --\u003e\n        \u003cscope\u003eprovided\u003c/scope\u003e\n    \u003c/dependency\u003e\n\n    \u003c!-- Runtime dependencies. --\u003e\n    \u003cdependency\u003e\n        \u003cgroupId\u003eorg.omnifaces\u003c/groupId\u003e\n        \u003cartifactId\u003eomnifaces\u003c/artifactId\u003e\n        \u003cversion\u003e3.13.3\u003c/version\u003e\u003c!-- Minimum supported version is 3.0 --\u003e\n    \u003c/dependency\u003e\n    \u003cdependency\u003e\n        \u003cgroupId\u003eorg.primefaces\u003c/groupId\u003e\n        \u003cartifactId\u003eprimefaces\u003c/artifactId\u003e\n        \u003cversion\u003e10.0.0\u003c/version\u003e\u003c!-- Minimum supported version is 10.0.0 --\u003e\n    \u003c/dependency\u003e\n    \u003cdependency\u003e\n        \u003cgroupId\u003eorg.omnifaces\u003c/groupId\u003e\n        \u003cartifactId\u003eoptimusfaces\u003c/artifactId\u003e\n        \u003cversion\u003e0.15\u003c/version\u003e\n    \u003c/dependency\u003e\n\u003c/dependencies\u003e\n```\n\n**Minumum supported Java / OmniFaces / PrimeFaces versions**\n\n- OptimusFaces 0.1 - 0.14: Java 11 / OmniFaces 2.2 / PrimeFaces 7.0\n- OptimusFaces 0.15+: Java 11 / OmniFaces 3.0 / PrimeFaces 10.0.0\n- OptimusFaces 0.14-J1+: Java 11 / OmniFaces 4.0 / PrimeFaces 10.0.0:jakarta\n- OptimusFaces 0.17-J1+: Java 17 / OmniFaces 4.0 / PrimeFaces 13.0.0:jakarta\n\n\n### Basic Usage\n\nFirst create your entity service extending [`org.omnifaces.omnipersistence.service.BaseEntityService`](https://static.javadoc.io/org.omnifaces/omnipersistence/latest/org/omnifaces/persistence/service/BaseEntityService.html). You don't necessarily need to add new methods, just extending it is sufficient. It's useful for other generic things too.\n\n```Java\n@Stateless\npublic class YourEntityService extends BaseEntityService\u003cLong, YourEntity\u003e {\n\n   // ...\n\n}\n```\n\nAnd make sure `YourEntity` extends [`org.omnifaces.omnipersistence.model.BaseEntity`](https://static.javadoc.io/org.omnifaces/omnipersistence/latest/org/omnifaces/persistence/model/BaseEntity.html) or one of its subclasses `GeneratedIdEntity`, `TimestampedEntity`, `TimestampedBaseEntity`, `VersionedEntity` or `VersionedBaseEntity`.\n\n```Java\n@Entity\npublic class YourEntity extends BaseEntity\u003cLong\u003e {\n\n    @Id @GeneratedValue(strategy=IDENTITY)\n    private Long id;\n    private Instant created;\n    private String name;\n    private Type type;\n    private boolean deleted;\n\n    // ...\n}\n```\n\nThen create a `org.omnifaces.optimusfaces.model.PagedDataModel` in your backing bean as below.\n\n```Java\n@Named\n@ViewScoped\npublic class YourBackingBean implements Serializable {\n\n    private PagedDataModel\u003cYourEntity\u003e model;\n\n    @Inject\n    private YourEntityService service;\n    \n    @PostConstruct\n    public void init() {\n        model = PagedDataModel.lazy(service).build();\n    }\n\n    public PagedDataModel\u003cYourEntity\u003e getModel() {\n        return model;\n    }\n\n}\n```\n\nFinally use `\u003cop:dataTable\u003e` to have a semi-dynamic lazy-loaded, pageable, sortable and filterable \n`\u003cp:dataTable\u003e` without much hassle.\n\n```XML\n\u003c... xmlns:op=\"http://omnifaces.org/optimusfaces\"\u003e\n\n\u003ch:form id=\"yourEntitiesForm\"\u003e\n    \u003cop:dataTable id=\"yourEntitiesTable\" value=\"#{yourBackingBean.model}\"\u003e\n        \u003cop:column field=\"id\" /\u003e\n        \u003cop:column field=\"created\" /\u003e\n        \u003cop:column field=\"name\" /\u003e\n        \u003cop:column field=\"type\" /\u003e\n        \u003cop:column field=\"deleted\" /\u003e\n    \u003c/op:dataTable\u003e\n\u003c/h:form\u003e\n```\n\nThe `field` attribute of `\u003cop:column\u003e` represents the entity property path. This will\nin turn be used in `id`, `field`, `headerText` and `filterBy` attributes\nof `\u003cp:column\u003e`.\n\nHere's how it looks like with default PrimeFaces UI and all. This example uses **exactly** the above Java and XHTML code with a `Person` entity with `Long id`, `String email`, `Gender gender` and `LocalDate dateOfBirth` fields.\n\n![example of op:dataTable](https://i.imgur.com/VJyNKMH.png)\n\n\n### Advanced Usage\n\n[Check `PagedDataModel` javadoc](http://static.javadoc.io/org.omnifaces/optimusfaces/latest/org/omnifaces/optimusfaces/model/PagedDataModel.html).\n\n\n### Known Issues\n\n- EclipseLink refuses to perform a `JOIN` with Criteria API when setFirstResult/setMaxResults is used. This returns a cartesian product. This has been workarounded, but this removes the ability to perform sorting on a column referenced by a join (`@OneToMany` and `@ElementCollection`). You should set such columns as `\u003cop:column ... sortable=\"false\"\u003e`. Another consequence is that you cannot search with a multi-valued criteria in a field referenced by a `@OneToMany` relationship. You should consider using a DTO instead.\n- OpenJPA adds internally a second `JOIN` when sorting a column referenced by a join (`@OneToMany` and `@ElementCollection`). This has as consequence that the sorting is performed on a different join than the one referenced in `GROUP BY` and will thus be off from what's presented. You should for now set such columns as `\u003cop:column ... sortable=\"false\"\u003e` or consider using a DTO instead.\n- OpenJPA does not correctly apply setFirstResult/setMaxResults when an `@OneToMany` relationship is involved in the query. It will basically apply it on the results of the `@OneToMany` relationship instead of on the query root, causing the page to contain fewer records than expected. There is no clear solution/workaround for that yet.\n\nThe [integration tests](https://github.com/omnifaces/optimusfaces/tree/develop/src/test/java/org/omnifaces/optimusfaces/test) currently run on [following environments](https://github.com/omnifaces/optimusfaces/actions/workflows/maven.yml):\n- WildFly 26.1.1 with Mojarra 2.3.17 and Hibernate 5.3.24\n- WildFly 26.1.1 with Mojarra 2.3.17 and EclipseLink 2.7.10\n- Payara 5.2022.2 with Mojarra 2.3.14 and Hibernate 5.4.33\n- Payara 5.2022.2 with Mojarra 2.3.14 and EclipseLink 2.7.9\n- TomEE 8.0.11 with MyFaces 2.3.9 and OpenJPA 3.2.2\n\nEach environment will run the IT on following databases:\n- H2 1.4.200 (embedded database)\n- MySQL latest 8.x (provided by GitHub Actions) with JDBC driver 8.0.29\n- PostgreSQL latest 12.x (provided by GitHub Actions) with JDBC driver 42.3.5\n\nEffectively, there are thus 15 full test runs of each [31 test cases](https://github.com/omnifaces/optimusfaces/blob/develop/src/test/java/org/omnifaces/optimusfaces/test/OptimusFacesIT.java#L429) on [19 XHTML files](https://github.com/omnifaces/optimusfaces/tree/develop/src/test/resources/org.omnifaces.optimusfaces.test).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fomnifaces%2Foptimusfaces","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fomnifaces%2Foptimusfaces","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fomnifaces%2Foptimusfaces/lists"}