ignite-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sury Sinha (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (IGNITE-1192) Provide integration with Spring Data
Date Tue, 20 Sep 2016 09:58:20 GMT

    [ https://issues.apache.org/jira/browse/IGNITE-1192?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15506225#comment-15506225
] 

Sury Sinha commented on IGNITE-1192:
------------------------------------

Hi Eduard,

Thanks for your reply. Following steps were done by us:

a) We loaded data of all database tables like "BinEntry" , "Dataload" , "Version" in separate
Ignite caches by same name as table name . For ex: Data of "BinEntry" table was stored in
a cache named as "BinEntry" and so on..
b) We did an override of findOne() in spring data repository of "BinEntry" table . Below is
the piece of code for override:
 @Override
 @Cacheable("BinEntry")
 BinEntry findOne(Integer id);
c) After doing the above two steps , on invoking findOne() , the data was returned from Ignite
cache rather than hitting the database.
d) Then we tried invoking another method from spring data repository of "BinEntry" table .
The query executed by this methopd joins another table "DataLoad " .
This did not work anyways.
 @Query("select  b from BinEntry b  where b.prefix = ( select max (prefix)  from BinEntry
binEntry where :prefix like binEntry.prefix " + 
            "and binEntry.dataLoad in ( select  d from DataLoad d join d.versions dt where
dt = :version ) )" +
            "and b.dataLoad in ( select  d from DataLoad d join d.versions dt where dt = :version
) )" +
            " order by b.id , b.cardType asc")
 @Cacheable("BinEntry")
 List<BinEntry> findByPrefixAndVersion(@Param("prefix") String prefix, @Param("version")
Version version);
e) We were also not sure what cache name should be used as parameter in @Cacheable annotation
for the second method as the second method would need to query on both "BinEntry" and "DataLoad"
caches.

Please let me know if you need more details. Also please let me know if there is any existing
implementation example of Spring Data + Ignite .
Cheers,
Sury

> Provide integration with Spring Data
> ------------------------------------
>
>                 Key: IGNITE-1192
>                 URL: https://issues.apache.org/jira/browse/IGNITE-1192
>             Project: Ignite
>          Issue Type: Bug
>          Components: general
>    Affects Versions: 1.1.4
>            Reporter: Valentin Kulichenko
>            Assignee: Eduard Shangareev
>            Priority: Minor
>              Labels: Newbie
>             Fix For: 1.8
>
>
> Spring Data docs:
> * http://docs.spring.io/spring-data/data-commons/docs/current/reference/html/
> * http://docs.spring.io/spring-data/data-commons/docs/current/api/



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message