Hypersistence Optimizer allows you to get the most out of JPA and Hibernate. By scanning your application configuration and mappings, Hypersistence Optimizer can tell you what changes you need to do to speed up your data access layer.
Hi I have chains with MovementEntities with a OneToOne relation.
public class MovementEntity {
...
@OneToOne(optional = true, fetch = FetchType.LAZY)
@JoinColumn(name = "PARENT_MOVEMENT_ID")
private MovementEntity parentClientSecurityMovement;
The optimizer show me this error:
Hypersistence Optimizer : CRITICAL - OneToOneWithoutMapsIdEvent - The [parentClientSecurityMovement] one-to-one association in the [tech.lightframe.shift.cbs.operation.MovementEntity] entity is using a separate Foreign Key to reference the parent record. Consider using @MapsId so that the identifier is shared with the parent row. For more info about this event, check out this User Guide link - https://vladmihalcea.com/hypersistence-optimizer/docs/user-guide/#OneToOneWithoutMapsIdEvent
But this strategy is not applicable when parent and child are in the same table. They are different instances and can't have the same Id.
I think the optimizer should filter these cases.
Hi I have chains with MovementEntities with a OneToOne relation.
The optimizer show me this error:
Hypersistence Optimizer : CRITICAL - OneToOneWithoutMapsIdEvent - The [parentClientSecurityMovement] one-to-one association in the [tech.lightframe.shift.cbs.operation.MovementEntity] entity is using a separate Foreign Key to reference the parent record. Consider using @MapsId so that the identifier is shared with the parent row. For more info about this event, check out this User Guide link - https://vladmihalcea.com/hypersistence-optimizer/docs/user-guide/#OneToOneWithoutMapsIdEvent
But this strategy is not applicable when parent and child are in the same table. They are different instances and can't have the same Id. I think the optimizer should filter these cases.