Conversation with Merlin [email protected] · Fri Dec 29 2023

String SanctionedAmt=tAdvSpecificDetailsRepo.SanctionedAmount(returnAdvPfClaimToIDSDto.getClaimId());

convert these into biginteger

To convert the string "SanctionedAmt" into a BigInteger in, you can use the BigInteger constructor that takes a string as a parameter. Here's how you can do it:

String SanctionedAmt = tAdvSpecificDetailsRepo.SanctionedAmountAdvPfClaimToIDSDto.getClaimId()); BigInteger sanctionedAmountBigInt = new BigInteger(SanctionedAmt);

By using the BigInteger constructor the string "SanctionedAmt", you can convert it a BigInteger.

Caused by: java.lang.IllegalStateException: Using named parameters for method public abstract void com.cmpfo.app.repository.TAdvSpecificDetailsRepo.updateAdvClaimSpecifcAmtAlrdyPaid(java.math.BigInteger,java.lang.String) but parameter 'Optional[amtPaid]' not found in annotated query 'UPDATE t_adv_specific_details SET amt_paid = amtPaid WHERE adv_claim_srno =(select adv_claim_srno from t_adv_claim where claim_id =:claimId)

The error message "Using named parameters for method public abstract void.cmpfo.app.repository.TAdvSpecificDetailsRepo.updateAdvClaimSpecifcAmtAlrdyPaid(java.math.BigInteger,java.lang.String) but parameter '[amtPaid]' not found in annotated query" suggests an issue with the named parameters in the method updateAdvClaimSpecifcAmtAlrdPaid of the repository interface TAdvSpecificDetailsRepo.

It appears that the named parameter amtPaid is not found in the annotated query. Make sure that the parameter amtPaid is used correctly in the query and is in the method signature.

Here's an example of how the method signature and query could be structured:

@Modifying @Query("UPDATE TAdvDetails SET amtPaid = :amtPaid WHERE advClaimSrNo = (SELECT advClaimSrNo FROM TAdvClaim WHERE claimId = :claimId)") void updateAdvClaimSpeccAmtAlrdyPaid(@Param("amtPaid") BigInteger amtPaid, @Param("claimId") String claimId); ` In this example, `@Param` annotation is used specify the named parameters in the method signature and query. Ensure that the named parameters in the query match the parameters in the method signature. Also, verify that the entity and field names in the query are correct. This should resolve the issue with the named parameters in the annotated query.

@Transactional @Modifying @Query(value ="UPDATE TAdvSpecificDetails SET amtPaid = :amtPaid WHERE advClaimSrNo =" + " (SELECT advClaimSrNo FROM TAdvClaim WHERE claimId = :claimId)" + "", nativeQuery = true) void updateAdvClaimSpecifcAmtAlrdyPaid(@Param("amtPaid") BigInteger amtPaid, @Param("claimId") String claimId);

do correct it

It seems there is a minor issue with the query setup. The query value should not end with an empty string at the end. Here's the corrected version of the method signature and query:

@Transactional @Modifying @Query(value ="UPDATE TAdvSpecificDetails SET amtPaid = :amtPaid WHERE advClaimSrNo =" + " (SELECT advClaimSrNo FROM TAdvClaim WHERE claimId = :claimId)" , nativeQuery = true) void updateAdvClaimSpecifcAmtAlrdyPaid(@Param("amtPaid") BigInteger amtPaid, @Param("claimId") String claimId);

In this corrected version, the query value does not end with an empty string, and the named parameters are correctly annotated using @Param. This should resolve the issue with the query.

Caused by: java.lang.IllegalArgumentException: The string < @Query(value = "SELECT CAST(sanctioned_amt_det AS text) FROM t_adv_specific_details JOIN t_adv_specific_details tsd ON tsd.adv_claim_srno =(select adv_claim_srno from t_adv_claim where claim_id =:claimId) > starts a quoted range at 16, but never ends it.

It appears that there is a syntax error in the provided query. The error is likely due to an unclosed quotation mark or an incomplete query string.

Here's the corrected version of the query, ensuring proper escape characters and closing quotation marks:

@Query(value = "SELECT CAST(sanctioned_amt_det AS text) FROM t_adv_specific_details JOIN t_adv_specific_details tsd ON tsd.adv_claim_srno = (select adv_claim_srno from t_adv_claim where claim_id = :claimId)", nativeQuery = true)

In this corrected version, the quotation marks are properly closed and the named parameter is correctly used. This should resolve the issue with the query.

Caused by: java.lang.IllegalArgumentException: The string < @Query(value = "SELECT CAST(sanctioned_amt_det AS text) FROM t_adv_specific_details JOIN t_adv_specific_details tsd ON tsd.adv_claim_srno =(select adv_claim_srno from t_adv_claim where claim_id =:claimId) > starts a quoted range at 16, but never ends it.

It seems that the provided query still has a syntax error. The error message indicates that the quotation marks are not closed properly or there is an incomplete query string.

Let's attempt to correct this issue by ensuring proper formatting and closing of the quotation in the query. Here's the proposed corrected version:

@Query(value = "SELECT CAST(sanctioned_amt_det AS text) FROM t_adv_specific_details JOIN t_adv_specific_details tsd ON tsd.adv_claim_srno = (select adv_claim_srno from t_claim where claim_id = :claimId)", nativeQuery = true)

In corrected version, the quotation marks are properly closed, and the named parameter is correctly used. Ensure that the corrected query is properly integrated into the code, and this should address the issue with the query syntax.