Skip to content
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

Closed
wants to merge 7 commits into from
Closed

Conversation

rajadilipkolli
Copy link
Owner

@rajadilipkolli rajadilipkolli commented Jan 29, 2024

Summary by CodeRabbit

  • New Features

    • Enhanced search capabilities for portfolio management feature, enabling users to retrieve details based on investor email and name.
  • Refactor

    • Updated portfolio service to utilize new entity views for improved data handling and presentation.

@rajadilipkolli rajadilipkolli self-assigned this Jan 29, 2024
Copy link
Contributor

coderabbitai bot commented Mar 12, 2024

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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.
Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.
Please see our FAQ for further information.

Commits Files that changed from the base of the PR and between 0223d3e and 9ad9860.

Walkthrough

The updates involve enhancing the repository and service layers to support custom queries for UserCASDetailsEntityView based on investor email and name. These changes introduce a custom repository interface and implementation, extend an existing repository, and update the service layer to use entity views instead of direct entity references for improved data handling.

Changes

Files Change Summary
.../repository/CustomUserCASDetailsEntityRepository.java
.../repository/CustomUserCASDetailsEntityRepositoryImpl.java
.../repository/UserCASDetailsEntityRepository.java
Introduced custom repository interface and implementation for querying UserCASDetailsEntityView by email and name, extended repository, and made minor formatting adjustments.
.../service/PortfolioService.java Replaced references from UserCASDetailsEntity to UserCASDetailsEntityView and commented out code for entity modifications.

🐰✨
In the realm of code, where logic threads weave,
A rabbit hopped in, with changes up its sleeve.
With a flick and a hop, it refined the query,
Making data dance, in a manner extraordinary.
🌟 "Behold," it exclaimed, "for the updates are neat,
Tailored and tuned, for performance so sweet!"
🥕🎉


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?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@rajadilipkolli rajadilipkolli marked this pull request as ready for review March 12, 2024 16:15
Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

Commits Files that changed from the base of the PR and between 3ff7bab and 78b455e.
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 and UserFolioDetailsEntityView 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 use UserCASDetailsEntityView 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.

Comment on lines +10 to +38
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();
}
Copy link
Contributor

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
    }
}

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

Commits Files that changed from the base of the PR and between 78b455e and 08c9004.
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

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

Commits Files that changed from the base of the PR and between 08c9004 and 0223d3e.
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 for UserCASDetailsEntityView and UserFolioDetailsEntityView are correctly added to support the new entity views. Good job on maintaining clean and organized imports.


130-131: Switching to UserCASDetailsEntityView in the findDelta 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 the findDelta method to use null for the userCASDetailsEntity 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.

Comment on lines +214 to +215
// TODO
// userCASDetailsEntityView.setFolioEntities(existingUserFolioDetailsEntityList);
Copy link
Contributor

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?

@rajadilipkolli
Copy link
Owner Author

closing in favor of #363

@rajadilipkolli rajadilipkolli deleted the blaze-views branch June 10, 2024 05:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant