-
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.
initial set up of blaze persistance views
- Loading branch information
1 parent
e5ec510
commit de95299
Showing
8 changed files
with
251 additions
and
1 deletion.
There are no files selected for viewing
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
57 changes: 57 additions & 0 deletions
57
src/main/java/com/learning/mfscreener/config/BlazePersistenceConfiguration.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,57 @@ | ||
/* | ||
* Copyright 2014 - 2024 Blazebit. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.learning.mfscreener.config; | ||
|
||
import com.blazebit.persistence.Criteria; | ||
import com.blazebit.persistence.CriteriaBuilderFactory; | ||
import com.blazebit.persistence.integration.view.spring.EnableEntityViews; | ||
import com.blazebit.persistence.spi.CriteriaBuilderConfiguration; | ||
import com.blazebit.persistence.spring.data.repository.config.EnableBlazeRepositories; | ||
import com.blazebit.persistence.view.EntityViewManager; | ||
import com.blazebit.persistence.view.spi.EntityViewConfiguration; | ||
import jakarta.persistence.EntityManagerFactory; | ||
import jakarta.persistence.PersistenceUnit; | ||
import org.springframework.beans.factory.config.ConfigurableBeanFactory; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.context.annotation.Lazy; | ||
import org.springframework.context.annotation.Scope; | ||
|
||
@Configuration | ||
@EnableEntityViews(basePackages = {"com.learning.mfscreener.models.entityviews"}) | ||
@EnableBlazeRepositories(basePackages = "com.learning.mfscreener.repository") | ||
public class BlazePersistenceConfiguration { | ||
|
||
@PersistenceUnit | ||
private EntityManagerFactory entityManagerFactory; | ||
|
||
@Bean | ||
@Scope(ConfigurableBeanFactory.SCOPE_SINGLETON) | ||
@Lazy(false) | ||
public CriteriaBuilderFactory createCriteriaBuilderFactory() { | ||
CriteriaBuilderConfiguration config = Criteria.getDefault(); | ||
return config.createCriteriaBuilderFactory(entityManagerFactory); | ||
} | ||
|
||
@Bean | ||
@Scope(ConfigurableBeanFactory.SCOPE_SINGLETON) | ||
@Lazy(false) | ||
public EntityViewManager createEntityViewManager( | ||
CriteriaBuilderFactory cbf, EntityViewConfiguration entityViewConfiguration) { | ||
return entityViewConfiguration.createEntityViewManager(cbf); | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
src/main/java/com/learning/mfscreener/models/entityviews/InvestorInfoEntityView.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,31 @@ | ||
package com.learning.mfscreener.models.entityviews; | ||
|
||
import com.blazebit.persistence.view.EntityView; | ||
import com.blazebit.persistence.view.IdMapping; | ||
import com.learning.mfscreener.entities.InvestorInfoEntity; | ||
import java.time.LocalDateTime; | ||
|
||
/** | ||
* EntityView for {@link com.learning.mfscreener.entities.InvestorInfoEntity} | ||
*/ | ||
@EntityView(InvestorInfoEntity.class) | ||
public interface InvestorInfoEntityView { | ||
String getCreatedBy(); | ||
|
||
LocalDateTime getCreatedDate(); | ||
|
||
String getLastModifiedBy(); | ||
|
||
LocalDateTime getLastModifiedDate(); | ||
|
||
@IdMapping | ||
Long getId(); | ||
|
||
String getEmail(); | ||
|
||
String getName(); | ||
|
||
String getMobile(); | ||
|
||
String getAddress(); | ||
} |
34 changes: 34 additions & 0 deletions
34
src/main/java/com/learning/mfscreener/models/entityviews/UserCASDetailsEntityView.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,34 @@ | ||
package com.learning.mfscreener.models.entityviews; | ||
|
||
import com.blazebit.persistence.view.EntityView; | ||
import com.blazebit.persistence.view.IdMapping; | ||
import com.learning.mfscreener.entities.CasTypeEnum; | ||
import com.learning.mfscreener.entities.FileTypeEnum; | ||
import com.learning.mfscreener.entities.UserCASDetailsEntity; | ||
import java.time.LocalDateTime; | ||
import java.util.List; | ||
|
||
/** | ||
* EntityView for {@link com.learning.mfscreener.entities.UserCASDetailsEntity} | ||
*/ | ||
@EntityView(UserCASDetailsEntity.class) | ||
public interface UserCASDetailsEntityView { | ||
String getCreatedBy(); | ||
|
||
LocalDateTime getCreatedDate(); | ||
|
||
String getLastModifiedBy(); | ||
|
||
LocalDateTime getLastModifiedDate(); | ||
|
||
@IdMapping | ||
Long getId(); | ||
|
||
CasTypeEnum getCasTypeEnum(); | ||
|
||
FileTypeEnum getFileTypeEnum(); | ||
|
||
InvestorInfoEntityView getInvestorInfoEntity(); | ||
|
||
List<UserFolioDetailsEntityView> getFolioEntities(); | ||
} |
34 changes: 34 additions & 0 deletions
34
src/main/java/com/learning/mfscreener/models/entityviews/UserFolioDetailsEntityView.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,34 @@ | ||
package com.learning.mfscreener.models.entityviews; | ||
|
||
import com.blazebit.persistence.view.EntityView; | ||
import com.blazebit.persistence.view.IdMapping; | ||
import com.learning.mfscreener.entities.UserFolioDetailsEntity; | ||
import java.time.LocalDateTime; | ||
import java.util.List; | ||
|
||
/** | ||
* EntityView for {@link com.learning.mfscreener.entities.UserFolioDetailsEntity} | ||
*/ | ||
@EntityView(UserFolioDetailsEntity.class) | ||
public interface UserFolioDetailsEntityView { | ||
String getCreatedBy(); | ||
|
||
LocalDateTime getCreatedDate(); | ||
|
||
String getLastModifiedBy(); | ||
|
||
LocalDateTime getLastModifiedDate(); | ||
|
||
@IdMapping | ||
Long getId(); | ||
|
||
String getFolio(); | ||
|
||
String getAmc(); | ||
|
||
String getPan(); | ||
|
||
String getKyc(); | ||
|
||
List<UserSchemeDetailsEntityView> getSchemeEntities(); | ||
} |
46 changes: 46 additions & 0 deletions
46
src/main/java/com/learning/mfscreener/models/entityviews/UserSchemeDetailsEntityView.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,46 @@ | ||
package com.learning.mfscreener.models.entityviews; | ||
|
||
import com.blazebit.persistence.view.EntityView; | ||
import com.blazebit.persistence.view.IdMapping; | ||
import com.learning.mfscreener.entities.UserSchemeDetailsEntity; | ||
import java.time.LocalDateTime; | ||
import java.util.List; | ||
|
||
/** | ||
* EntityView for {@link com.learning.mfscreener.entities.UserSchemeDetailsEntity} | ||
*/ | ||
@EntityView(UserSchemeDetailsEntity.class) | ||
public interface UserSchemeDetailsEntityView { | ||
String getCreatedBy(); | ||
|
||
LocalDateTime getCreatedDate(); | ||
|
||
String getLastModifiedBy(); | ||
|
||
LocalDateTime getLastModifiedDate(); | ||
|
||
@IdMapping | ||
Long getId(); | ||
|
||
String getScheme(); | ||
|
||
String getIsin(); | ||
|
||
String getAdvisor(); | ||
|
||
String getRtaCode(); | ||
|
||
String getRta(); | ||
|
||
String getType(); | ||
|
||
Long getAmfi(); | ||
|
||
String getMyopen(); | ||
|
||
String getClose(); | ||
|
||
String getCloseCalculated(); | ||
|
||
List<UserTransactionDetailsEntityView> getTransactionEntities(); | ||
} |
40 changes: 40 additions & 0 deletions
40
...ain/java/com/learning/mfscreener/models/entityviews/UserTransactionDetailsEntityView.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,40 @@ | ||
package com.learning.mfscreener.models.entityviews; | ||
|
||
import com.blazebit.persistence.view.EntityView; | ||
import com.blazebit.persistence.view.IdMapping; | ||
import com.learning.mfscreener.entities.UserTransactionDetailsEntity; | ||
import java.time.LocalDate; | ||
import java.time.LocalDateTime; | ||
|
||
/** | ||
* EntityView for {@link com.learning.mfscreener.entities.UserTransactionDetailsEntity} | ||
*/ | ||
@EntityView(UserTransactionDetailsEntity.class) | ||
public interface UserTransactionDetailsEntityView { | ||
String getCreatedBy(); | ||
|
||
LocalDateTime getCreatedDate(); | ||
|
||
String getLastModifiedBy(); | ||
|
||
LocalDateTime getLastModifiedDate(); | ||
|
||
@IdMapping | ||
Long getId(); | ||
|
||
LocalDate getTransactionDate(); | ||
|
||
String getDescription(); | ||
|
||
Double getAmount(); | ||
|
||
Double getUnits(); | ||
|
||
Double getNav(); | ||
|
||
Double getBalance(); | ||
|
||
String getType(); | ||
|
||
String getDividendRate(); | ||
} |