Use this file to discover all available pages before exploring further.
WebJET CMS uses EclipseLink JPA as its JPA provider, fully integrated with Spring Data JPA. EclipseLink implements the JPA standard, so all standard annotations and Spring Data patterns apply.A solid starting point for the underlying standards:
EclipseLink and Spring Data work together smoothly when you follow these rules:
Attribute types must be object wrappers — use Integer, Long, Boolean, not int, long, boolean. Primitive types cannot be set to null, which breaks “query by example” lookups in repositories.
The primary key must be Long.
Use the IDENTITY strategy for auto-increment columns. For Oracle, set the sequence name in the generator attribute.
@Getter and @Setter are provided by Project Lombok and generate all accessor methods at compile time. @DataTableColumn controls how the field is rendered in the DataTable UI.
Avoid the older @GeneratedValue / @TableGenerator pattern using PkeyGenerator. It is deprecated since WebJET 2021. Use GenerationType.IDENTITY instead.
When two tables share a large set of identical columns (for example documents and documents_history), extract the shared columns into a @MappedSuperclass. This avoids duplicating field declarations while keeping each table as an independent entity.
import jakarta.persistence.MappedSuperclass;import java.io.Serializable;@MappedSuperclasspublic class DocBasic implements DocGroupInterface, Serializable { // Shared columns declared here — no @Getter/@Setter on this class private String title; private String virtualPath; // ... // All getters and setters written manually public String getTitle() { return title; } public void setTitle(String title) { this.title = title; }}
Do not use Lombok @Getter / @Setter on the @MappedSuperclass parent class. JPA’s reflection-based method inheritance does not work with Lombok-generated methods in superclasses and will throw NoSuchMethodError at runtime. Write all getters and setters by hand in the parent class.
Child classes that extend the superclass require no extra annotations beyond @Entity and @Table. Methods from the parent can be overridden normally.
Declare a repository interface extending JpaRepository and, if you need DataTable filtering, JpaSpecificationExecutor:
import org.springframework.data.jpa.repository.JpaRepository;import org.springframework.data.jpa.repository.JpaSpecificationExecutor;import org.springframework.stereotype.Repository;@Repositorypublic interface GalleryRepository extends JpaRepository<GalleryEntity, Long>, JpaSpecificationExecutor<GalleryEntity> { // Spring Data generates the SQL from the method name List<GalleryEntity> findByGroupId(Long groupId); List<GalleryEntity> findByTitleContainingIgnoreCase(String title);}
JpaSpecificationExecutor enables the DatatableRestControllerV2 to build dynamic filter queries from the DataTable column search inputs without any additional code.
Use MapStruct to convert JPA entities to lightweight DTO objects for REST responses or history views. The mapper interface is implemented automatically at compile time.
// Original list of DocDetails objects from the databaseList<DocDetails> list = historyDB.getHistory(docId, false, false);// Map to DTO objects for the REST responseList<DocHistoryDto> dtoList = DocHistoryDtoMapper.INSTANCE.toHistoryDtos(list);
Full MapStruct mapping options are documented at mapstruct.org.
Use Spring’s @Transactional annotation on service methods that span multiple repository operations. For repository methods that modify data without returning results, also add @Modifying (as shown in the custom query example above).
DatatableRestControllerV2 manages transactions for standard CRUD operations automatically. You only need explicit @Transactional annotations in custom service or repository methods.
WebJET CMS supports the following databases. EclipseLink’s dialect abstraction handles the differences transparently in most cases:
MySQL / MariaDB
Primary development and CI target. Most examples and default configurations reference MySQL syntax.
PostgreSQL
Fully supported. Use GenerationType.IDENTITY for sequences — PostgreSQL uses SERIAL / GENERATED AS IDENTITY natively.
Microsoft SQL Server
Supported via the MSSQL EclipseLink platform. IDENTITY columns map to SQL Server’s IDENTITY(1,1).
Oracle
Supported. Sequences are required for auto-increment columns — set the sequence name in @GeneratedValue(generator = "S_table_name").
Always use Integer / Long (object wrappers) rather than int / long for entity fields. This ensures correct NULL handling across all supported databases when using Spring Data query-by-example.