Inspectopedia 2024.3 Help

JPA

Association field marked with @Colum   New in this release

Detects incorrect use of @Column annotation for association attributes with @OneToOne and @ManyToOne annotations.

Entity attribute is not marked with association annotation   New in this release

Checks for associations that are not marked with corresponding annotations.

Entity has more than one id attribute.   New in this release

Checks for multiple id attributes in one entity.

Entity listener problems   New in this release

Reports the following JPA specification errors:.

Entity listener warnings   New in this release

Reports entity listener classes without any entity listener methods.

For @ManyToMany associations, the REMOVE entity state transition doesn't make sense to be cascaded because it will propagate beyond the link table.   New in this release

Checks for @ManyToMany associations with the CascadeType.REMOVE attribute.

JPA converter must be annotated with @Converter annotation   New in this release

Checks for the presence of @Converter annotation on JPA converter.

Lombok @Builder needs a proper constructor for this class   New in this release

Checks that all-args constructor exists for @lombok.Builder in JPA entities.

Orm.xml problems   New in this release

Reports unresolved references to any database objects inside `orm.xml` configuration files:.

Persistence.xml is not added to facet   New in this release

Reports missing persistence.xml configuration files and suggests adding the file to the persistence facet.

Persistent attribute signature checks   New in this release

Reports the following JPA specification errors:.

Persistent attribute type checks   New in this release

Reports property type mismatch for JPA attributes.

Persistent entity misses primary key   New in this release

Reports missing identification property persistence objects.

Persistent object class signature checks   New in this release

Reports incorrectly defined persistent object classes in the following cases:.

Query language checks   New in this release

Reports the following errors inside Persistence QL queries: Mismatching expression types Incorrect parameters Empty or constant conditions Unresolved symbols Example queries: SELECT OBJECT(e) FROM JavaEntity e WHERE TRUE // Warning: constant condition SELECT OBJECT(e) FROM JavaEntity e WHERE e.id BETWEEN 0 AND '2' // Error: expected a numeric value but got a string SELECT e from JavaEntity e where e.id=?1 and e.name=?3 // Error: there are only 2 actual query parameters.

Specifying FetchType.LAZY for the non-owning side of the @OneToOne association will not affect the loading. The related entity will still be loaded as if the FetchType.EAGER is defined.   New in this release

Checks for the non-owning side of the @OneToOne associations with the FetchType.Lazy attribute.

Unresolved database references in XML   New in this release

Reports Persistence ORM XML descriptors that cannot be resolved within the configured datasource and suggests refreshing the datasource or assigning a different one.

Unresolved database references in annotations   New in this release

Reports references inside the following Persistence ORM annotations if they cannot be resolved within the configured datasource:.

Unresolved entity graph names   New in this release

Reports the following unresolved attributes inside EntityGraph-related annotations:.

Unresolved queries and query parameters   New in this release

Reports unresolved symbols in named and native queries and related API methods: Unknown named query Unknown query parameter Example: @Entity @NamedQuery(name = "SelectByConditionQuery", query = "...") public class JavaEntity { ..

Unresolved references in queries   New in this release

Reports unresolved symbols in the following JPA annotations and API methods:.

Using @AllArgsConstructor for JPA entities without defined no-argument constructor breaks JPA specification.   New in this release

Checks that @lombok.AllArgsConstructor used in JPA entities.

Using @Builder for JPA entities without defined no-argument constructor breaks JPA specification.   New in this release

Checks that @lombok.Builder used in JPA entities.

persistence.xml problems   New in this release

Reports the following problems inside XML configuration files:.

Last modified: 03 December 2024