-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat : using blaze multiselect views #287
Conversation
Warning Rate Limit Exceeded@rajadilipkolli has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 12 minutes and 3 seconds before requesting another review. How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. WalkthroughThe updates involve enhancing the repository and service layers to support custom queries for Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 2
Configuration used: CodeRabbit UI
Files selected for processing (4)
- src/main/java/com/learning/mfscreener/repository/CustomUserCASDetailsEntityRepository.java (1 hunks)
- src/main/java/com/learning/mfscreener/repository/CustomUserCASDetailsEntityRepositoryImpl.java (1 hunks)
- src/main/java/com/learning/mfscreener/repository/UserCASDetailsEntityRepository.java (2 hunks)
- src/main/java/com/learning/mfscreener/service/PortfolioService.java (5 hunks)
Additional comments: 4
src/main/java/com/learning/mfscreener/repository/CustomUserCASDetailsEntityRepository.java (1)
- 5-7: The interface and method declaration look good. It's clear and follows Java conventions. The method
findByInvestorEmailAndName
is well-named, indicating its purpose and the parameters it expects.src/main/java/com/learning/mfscreener/repository/UserCASDetailsEntityRepository.java (1)
- 14-15: Extending
CustomUserCASDetailsEntityRepository
is a good approach for integrating custom repository operations with existing JpaRepository functionalities. This aligns well with the PR objectives.src/main/java/com/learning/mfscreener/service/PortfolioService.java (2)
- 17-18: The introduction of
UserCASDetailsEntityView
andUserFolioDetailsEntityView
aligns well with the PR objectives to optimize data handling and improve performance. Good job on leveraging entity views for this purpose.- 115-130: > 📝 NOTE
This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [106-251]
The updates to the
findDelta
method to useUserCASDetailsEntityView
are a positive change. However, there are commented-out code segments (e.g., lines 126-127, 190-191) that suggest incomplete refactoring or placeholders for future work. It's generally best to avoid leaving commented-out code in the codebase as it can lead to confusion. Consider removing these segments or adding clear comments explaining their purpose.
public class CustomUserCASDetailsEntityRepositoryImpl implements CustomUserCASDetailsEntityRepository { | ||
|
||
private final EntityManager entityManager; | ||
|
||
private final CriteriaBuilderFactory criteriaBuilderFactory; | ||
|
||
private final EntityViewManager entityViewManager; | ||
|
||
public CustomUserCASDetailsEntityRepositoryImpl( | ||
EntityManager entityManager, | ||
CriteriaBuilderFactory criteriaBuilderFactory, | ||
EntityViewManager entityViewManager) { | ||
this.entityManager = entityManager; | ||
this.criteriaBuilderFactory = criteriaBuilderFactory; | ||
this.entityViewManager = entityViewManager; | ||
} | ||
|
||
@Override | ||
public UserCASDetailsEntityView findByInvestorEmailAndName(String email, String name) { | ||
return entityViewManager | ||
.applySetting( | ||
EntityViewSetting.create(UserCASDetailsEntityView.class), | ||
criteriaBuilderFactory.create(entityManager, UserCASDetailsEntity.class)) | ||
.where("investorInfoEntity.email") | ||
.eq(email) | ||
.where("investorInfoEntity.name") | ||
.eq(name) // Adding condition for the name | ||
.getSingleResult(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The class declaration, fields, and constructor are correctly implemented, ensuring proper dependency management. The method findByInvestorEmailAndName
uses EntityViewManager
and CriteriaBuilderFactory
effectively to query UserCASDetailsEntity
based on email and name. However, consider handling NoResultException
that getSingleResult()
may throw if no entity matches the criteria.
public UserCASDetailsEntityView findByInvestorEmailAndName(String email, String name) {
try {
return entityViewManager
.applySetting(
EntityViewSetting.create(UserCASDetailsEntityView.class),
criteriaBuilderFactory.create(entityManager, UserCASDetailsEntity.class))
.where("investorInfoEntity.email")
.eq(email)
.where("investorInfoEntity.name")
.eq(name)
.getSingleResult();
} catch (jakarta.persistence.NoResultException e) {
return null; // Or handle accordingly
}
}
src/main/java/com/learning/mfscreener/repository/UserCASDetailsEntityRepository.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (2)
- src/main/java/com/learning/mfscreener/repository/UserCASDetailsEntityRepository.java (2 hunks)
- src/main/java/com/learning/mfscreener/service/PortfolioService.java (5 hunks)
Files skipped from review as they are similar to previous changes (2)
- src/main/java/com/learning/mfscreener/repository/UserCASDetailsEntityRepository.java
- src/main/java/com/learning/mfscreener/service/PortfolioService.java
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Review Status
Configuration used: CodeRabbit UI
Files selected for processing (1)
- src/main/java/com/learning/mfscreener/service/PortfolioService.java (5 hunks)
Additional comments not posted (4)
src/main/java/com/learning/mfscreener/service/PortfolioService.java (4)
17-18
: The import statements forUserCASDetailsEntityView
andUserFolioDetailsEntityView
are correctly added to support the new entity views. Good job on maintaining clean and organized imports.
130-131
: Switching toUserCASDetailsEntityView
in thefindDelta
method aligns with the PR's goal of optimizing data handling through entity views. This is a positive change towards improving data access efficiency.
150-151
: Commented-out code for adding folio entities suggests a transition towards a view-centric approach. However, it's important to ensure that the logic for handling new folios and transactions is appropriately adapted or implemented elsewhere to maintain functionality.Please verify that the logic for handling new folios and transactions is correctly implemented in the new architecture and that this commented-out section does not lead to lost functionality.
275-275
: Adjusting the return value in thefindDelta
method to usenull
for theuserCASDetailsEntity
parameter aligns with the shift towards entity views. Ensure this change does not adversely affect downstream operations that may rely on this data.Please verify that the adjusted return value does not impact the functionality or integration points that expect a non-null
userCASDetailsEntity
.
// TODO | ||
// userCASDetailsEntityView.setFolioEntities(existingUserFolioDetailsEntityList); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The TODO comment indicates unfinished work or a placeholder for future implementation. It's crucial to track these tasks to ensure they are completed or addressed in subsequent updates.
Would you like assistance in implementing the functionality mentioned in the TODO comment, or should it be tracked as an issue for future resolution?
closing in favor of #363 |
Summary by CodeRabbit
New Features
Refactor