EAFixNextAndPreviousFromQuery
This document was generated using Claude.ai
Overview
Repairs and updates the chain linkages between consecutive rent contracts by fixing previous/next contract references. Processes committed rent contracts to ensure proper contract sequencing and renter history tracking through automated reference updates.
When This Action Runs
Manual execution for data repair and maintenance. Typically used after contract imports, data migrations, or when contract chain linkages become corrupted due to system issues or manual data modifications.
How It Works
- Executes query - Runs SQL query to identify contracts that need chain fixing
- Processes each contract - Iterates through found contracts in separate transactions
- Fills previous contract - Updates references to the immediately preceding contract
- Updates previous renter - Links to previous contract for the same renter
- Updates next contract - Sets references to the immediately following contract
- Updates next renter - Links to next contract for the same renter
- Commits changes - All updates happen automatically without explicit saving
Parameters
Parameter 1: Manual Query (Optional) - Custom SQL query to specify which contracts to fix
Default Query
select entityType,id from RERentContract where commitedBefore = 1
union all
select entityType,id from REOpeningRentContract where commitedBefore = 1
Database Tables Affected
- RERentContract - Updates previous/next contract references
- REOpeningRentContract - Updates previous/next contract references for opening contracts
- Contract Chain Tables - Updates linkage information between related contracts
Module: realestate
Full Class Name: com.namasoft.modules.realstate.domain.utils.plugnplay.EAFixNextAndPreviousFromQuery