-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat : using blaze multiselect views
- Loading branch information
1 parent
730a00c
commit 5f33418
Showing
4 changed files
with
60 additions
and
15 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
src/main/java/com/learning/mfscreener/repository/CustomUserCASDetailsEntityRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package com.learning.mfscreener.repository; | ||
|
||
import com.learning.mfscreener.models.entityviews.UserCASDetailsEntityView; | ||
|
||
public interface CustomUserCASDetailsEntityRepository { | ||
|
||
UserCASDetailsEntityView findByInvestorEmailAndName(String email, String name); | ||
} |
39 changes: 39 additions & 0 deletions
39
...ain/java/com/learning/mfscreener/repository/CustomUserCASDetailsEntityRepositoryImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package com.learning.mfscreener.repository; | ||
|
||
import com.blazebit.persistence.CriteriaBuilderFactory; | ||
import com.blazebit.persistence.view.EntityViewManager; | ||
import com.blazebit.persistence.view.EntityViewSetting; | ||
import com.learning.mfscreener.entities.UserCASDetailsEntity; | ||
import com.learning.mfscreener.models.entityviews.UserCASDetailsEntityView; | ||
import jakarta.persistence.EntityManager; | ||
|
||
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(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters