LiJie20190102 opened a new pull request, #12972:
URL: https://github.com/apache/gravitino/pull/12972

   
   
   ### What changes were proposed in this pull request?
   
   Replace seven duplicated @Results annotation blocks in PolicyMetaMapper with 
two named declarations (@Results(id = ...)) referenced by @ResultMap, matching 
the convention already used in FunctionMetaMapper and ViewMetaMapper.
   
   policyPOResultMap: 16-column mapping (with policyVersionPO), 1 declaration + 
3 references
   policyOnlyPOResultMap: 8-column mapping (without policyVersionPO), 1 
declaration + 2 references
   A column addition or rename now requires changing only the single 
declaration instead of up to seven copies.
   
   ### Why are the changes needed?
   
   (Please clarify why the changes are needed. For instance,
     1. If you propose a new API, clarify the use case for a new API.
     2. If you fix a bug, describe the bug.)
   
   Fix: #12970 
   
   ### Does this PR introduce _any_ user-facing change?
   
   (Please list the user-facing changes introduced by your change, including
     1. Change in user-facing APIs.
     2. Addition or removal of property keys.)
   
   ### How was this patch tested?
   
   || Mapper Method | Test Method |
   |---|---|
   | `listPolicyPOsByMetalake` | `testCreateAndListPolicies` |
   | `listPolicyPOsByMetalakeAndPolicyNames` | 
`testMetaLifeCycleFromCreationToDeletion` |
   | `selectPolicyMetaByMetalakeAndName` | 
`testInsertAndGetPolicyByIdentifier`, `testUpdatePolicy` |
   | `selectPolicyMetaByMetalakeIdAndName` | 
`testMetaLifeCycleFromCreationToDeletion` |
   | `batchSelectPolicyByIdentifier` | 
`testAssociateAndDisassociatePoliciesWithMetadataObject` |
   | `listPolicyPOsByPolicyIds` | 
`testAssociateAndDisassociatePoliciesWithMetadataObject` |
   | `selectPolicyByPolicyId` | _(no direct caller, shares the same 
`policyOnlyPOResultMap` as `selectPolicyMetaByMetalakeIdAndName`)_ |
   
   `selectPolicyByPolicyId` has no direct caller in the service layer, but it 
shares the same `policyOnlyPOResultMap` as 
`selectPolicyMetaByMetalakeIdAndName`, which is covered by 
`testMetaLifeCycleFromCreationToDeletion`. Both methods use the identical 
column mapping, so the coverage is equivalent.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to