-
-
Save protyay-gintaa/9070060d5ff9a7120998c83913ace197 to your computer and use it in GitHub Desktop.
Ignite Code Repo
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
@RepositoryConfig(cacheName = "dealRepositoryCache") | |
public interface DealIgniteRepository extends IgniteRepository<DealsMasterEntity, Long> { | |
} |
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
@Entity | |
@Table(name = "deal_status_master", schema = "gintaa_deals_dev", catalog = "gintaa_deals") | |
public class DealStatusEntity implements Serializable { | |
@QuerySqlField | |
private long id; | |
@QuerySqlField | |
private String dealStatusCode; | |
@QuerySqlField | |
private String dealStatusDesc; | |
@QuerySqlField | |
private boolean isActive; | |
//Getters, setters are omitted for brevity |
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
Caused by: java.lang.IllegalArgumentException: Failed to create query for method public abstract java.lang.Object org.apache.ignite.springdata22.repository.IgniteRepository.save(java.io.Serializable,java.lang.Object)! No property save found for type DealStatusEntity! | |
at org.springframework.data.jpa.repository.query.PartTreeJpaQuery.<init>(PartTreeJpaQuery.java:96) ~[spring-data-jpa-2.2.4.RELEASE.jar!/:2.2.4.RELEASE] | |
at org.springframework.data.jpa.repository.query.JpaQueryLookupStrategy$CreateQueryLookupStrategy.resolveQuery(JpaQueryLookupStrategy.java:103) ~[spring-data-jpa-2.2.4.RELEASE.jar!/:2.2.4.RELEASE] | |
at org.springframework.data.jpa.repository.query.JpaQueryLookupStrategy$CreateIfNotFoundQueryLookupStrategy.resolveQuery(JpaQueryLookupStrategy.java:209) ~[spring-data-jpa-2.2.4.RELEASE.jar!/:2.2.4.RELEASE] | |
at org.springframework.data.jpa.repository.query.JpaQueryLookupStrategy$AbstractQueryLookupStrategy.resolveQuery(JpaQueryLookupStrategy.java:78) ~[spring-data-jpa-2.2.4.RELEASE.jar!/:2.2.4.RELEASE] | |
at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.lookupQuery(RepositoryFactorySupport.java:574) ~[spring-data-commons-2.2.4.RELEASE.jar!/:2.2.4.RELEASE] | |
at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.lambda$mapMethodsToQuery$1(RepositoryFactorySupport.java:567) ~[spring-data-commons-2.2.4.RELEASE.jar!/:2.2.4.RELEASE] | |
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195) ~[na:na] | |
at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133) ~[na:na] | |
at java.base/java.util.Collections$UnmodifiableCollection$1.forEachRemaining(Collections.java:1054) ~[na:na] | |
at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801) ~[na:na] | |
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484) ~[na:na] | |
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474) ~[na:na] | |
at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913) ~[na:na] | |
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[na:na] | |
at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578) ~[na:na] | |
at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.mapMethodsToQuery(RepositoryFactorySupport.java:569) ~[spring-data-commons-2.2.4.RELEASE.jar!/:2.2.4.RELEASE] | |
at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.lambda$new$0(RepositoryFactorySupport.java:559) ~[spring-data-commons-2.2.4.RELEASE.jar!/:2.2.4.RELEASE] | |
at java.base/java.util.Optional.map(Optional.java:258) ~[na:na] | |
at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.<init>(RepositoryFactorySupport.java:559) ~[spring-data-commons-2.2.4.RELEASE.jar!/:2.2.4.RELEASE] | |
at org.springframework.data.repository.core.support.RepositoryFactorySupport.getRepository(RepositoryFactorySupport.java:332) ~[spring-data-commons-2.2.4.RELEASE.jar!/:2.2.4.RELEASE] | |
at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.lambda$afterPropertiesSet$5(RepositoryFactoryBeanSupport.java:297) ~[spring-data-commons-2.2.4.RELEASE.jar!/:2.2.4.RELEASE] | |
at org.springframework.data.util.Lazy.getNullable(Lazy.java:212) ~[spring-data-commons-2.2.4.RELEASE.jar!/:2.2.4.RELEASE] | |
at org.springframework.data.util.Lazy.get(Lazy.java:94) ~[spring-data-commons-2.2.4.RELEASE.jar!/:2.2.4.RELEASE] | |
at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.afterPropertiesSet(RepositoryFactoryBeanSupport.java:300) ~[spring-data-commons-2.2.4.RELEASE.jar!/:2.2.4.RELEASE] | |
at org.springframework.data.jpa.repository.support.JpaRepositoryFactoryBean.afterPropertiesSet(JpaRepositoryFactoryBean.java:121) ~[spring-data-jpa-2.2.4.RELEASE.jar!/:2.2.4.RELEASE] | |
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1855) ~[spring-beans-5.2.3.RELEASE.jar!/:5.2.3.RELEASE] | |
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1792) ~[spring-beans-5.2.3.RELEASE.jar!/:5.2.3.RELEASE] | |
... 37 common frames omitted | |
Caused by: org.springframework.data.mapping.PropertyReferenceException: No property save found for type DealStatusEntity! | |
at org.springframework.data.mapping.PropertyPath.<init>(PropertyPath.java:94) ~[spring-data-commons-2.2.4.RELEASE.jar!/:2.2.4.RELEASE] | |
at org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:382) ~[spring-data-commons-2.2.4.RELEASE.jar!/:2.2.4.RELEASE] | |
at org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:358) ~[spring-data-commons-2.2.4.RELEASE.jar!/:2.2.4.RELEASE] | |
at org.springframework.data.mapping.PropertyPath.lambda$from$0(PropertyPath.java:311) ~[spring-data-commons-2.2.4.RELEASE.jar!/:2.2.4.RELEASE] | |
at java.base/java.util.concurrent.ConcurrentMap.computeIfAbsent(ConcurrentMap.java:330) ~[na:na] | |
at org.springframework.data.mapping.PropertyPath.from(PropertyPath.java:293) ~[spring-data-commons-2.2.4.RELEASE.jar!/:2.2.4.RELEASE] | |
at org.springframework.data.mapping.PropertyPath.from(PropertyPath.java:276) ~[spring-data-commons-2.2.4.RELEASE.jar!/:2.2.4.RELEASE] | |
at org.springframework.data.repository.query.parser.Part.<init>(Part.java:82) ~[spring-data-commons-2.2.4.RELEASE.jar!/:2.2.4.RELEASE] | |
at org.springframework.data.repository.query.parser.PartTree$OrPart.lambda$new$0(PartTree.java:250) ~[spring-data-commons-2.2.4.RELEASE.jar!/:2.2.4.RELEASE] | |
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195) ~[na:na] | |
at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177) ~[na:na] | |
at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948) ~[na:na] | |
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484) ~[na:na] | |
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474) ~[na:na] | |
at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913) ~[na:na] | |
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[na:na] | |
at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578) ~[na:na] | |
at org.springframework.data.repository.query.parser.PartTree$OrPart.<init>(PartTree.java:251) ~[spring-data-commons-2.2.4.RELEASE.jar!/:2.2.4.RELEASE] | |
at org.springframework.data.repository.query.parser.PartTree$Predicate.lambda$new$0(PartTree.java:380) ~[spring-data-commons-2.2.4.RELEASE.jar!/:2.2.4.RELEASE] | |
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195) ~[na:na] | |
at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177) ~[na:na] | |
at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948) ~[na:na] | |
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484) ~[na:na] | |
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474) ~[na:na] | |
at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913) ~[na:na] | |
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[na:na] | |
at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578) ~[na:na] | |
at org.springframework.data.repository.query.parser.PartTree$Predicate.<init>(PartTree.java:381) ~[spring-data-commons-2.2.4.RELEASE.jar!/:2.2.4.RELEASE] | |
at org.springframework.data.repository.query.parser.PartTree.<init>(PartTree.java:93) ~[spring-data-commons-2.2.4.RELEASE.jar!/:2.2.4.RELEASE] | |
at org.springframework.data.jpa.repository.query.PartTreeJpaQuery.<init>(PartTreeJpaQuery.java:89) ~[spring-data-jpa-2.2.4.RELEASE.jar!/:2.2.4.RELEASE] | |
... 63 common frames omitted | |
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
@Configuration | |
@EnableIgniteRepositories | |
public class IgniteConfig { | |
@Bean | |
public Ignite igniteInstance() { | |
IgniteConfiguration igniteConfiguration = new IgniteConfiguration(); | |
// Setting some custom name for the node. | |
igniteConfiguration.setIgniteInstanceName("gintaaDealsDataNode"); | |
// Enabling peer-class loading feature. | |
igniteConfiguration.setPeerClassLoadingEnabled(true); | |
// Defining and creating a new cache to be used by Ignite Spring Data | |
// repository. | |
CacheConfiguration dealRepositoryCache = new CacheConfiguration("dealRepositoryCache"); | |
dealRepositoryCache.setReadThrough(true); | |
dealRepositoryCache.setWriteThrough(true); | |
dealRepositoryCache.setWriteBehindEnabled(true); | |
CacheConfiguration dealStatusIgniteRepositoryCache = new CacheConfiguration( | |
"dealStatusIgniteRepositoryCache"); | |
dealStatusIgniteRepositoryCache.setWriteBehindEnabled(true); | |
dealStatusIgniteRepositoryCache.setWriteThrough(true); | |
dealStatusIgniteRepositoryCache.setReadThrough(true); | |
// Setting SQL schema for the cache. | |
dealStatusIgniteRepositoryCache.setIndexedTypes(Long.class, DealStatusEntity.class); | |
dealRepositoryCache.setIndexedTypes(Long.class, DealsMasterEntity.class); | |
igniteConfiguration.setCacheConfiguration(dealRepositoryCache, | |
dealStatusIgniteRepositoryCache); | |
return Ignition.start(igniteConfiguration); | |
} | |
} |
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
@SpringBootApplication | |
@EnableEurekaClient | |
@EnableSwagger2WebMvc | |
@EnableConfigurationProperties | |
public class GintaaApplication { | |
private static final Logger logger = LoggerFactory.getLogger(GintaaApplication.class); | |
@Autowired | |
private DealStatusIgniteRepository dealStatusIgniteRepository; | |
public static void main(String[] args) { | |
SpringApplication.run(GintaaApplication.class, args); | |
} | |
@EventListener(value = ApplicationReadyEvent.class) | |
public void populateDealStatusData() { | |
DealStatusEntity dealStatus = new DealStatusEntity(); | |
dealStatus.setDealStatusCode(DealStates.ACCEPTED.name()); | |
dealStatus.setDealStatusCode("Deal made has been accepted against an offer"); | |
Map<Long, DealStatusEntity> dealStatusEntityMap = new TreeMap<>(); | |
dealStatusEntityMap.put(1L, dealStatus); | |
final Iterable<DealStatusEntity> dealSavedRepo = dealStatusIgniteRepository.save(dealStatusEntityMap); | |
logger.debug("dealSavedRepo", dealSavedRepo); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment