在基于旧版Java sql的项目中集成apache ignite的问题 [英] Integrating apache ignite in legacy java sql based project joins issue

查看:170
本文介绍了在基于旧版Java sql的项目中集成apache ignite的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个遗留的Java项目,其中有1000多个表和许多SQL查询.

I have a legacy java project where I have more than 1000 table and a lot of SQL queries.

为了获得更好的查询性能,我正在研究内存数据库中的apache ignite,我不想使用第三方持久性机制,后者基于我在POC中成功实现的缓存(CacheStore),不幸的是,我有很多带有很多联接的复杂查询,在这种情况下,我必须使用缓存存储区名称来更新我的查询,如示例

In order to achieve a better querying performance I m studying the apache ignite in memory database where I wan't to use the 3rd party persistence mechanism, the later is based on caching (CacheStore) that I implemented successfully in my POC, unfortunately I have lot of complex queries with lot of joins, in this case I have to update my queries using cache store names as in the example

    private static void select(IgniteCache<Long, Person> personCache, String msg) {
        String sql =
            "select p.id, concat(p.firstName, ' ', p.lastName), o.name, p.resume, p.salary " +
            "from Person as p, \"" + ORG_CACHE + "\".Organization as o " +
            "where p.orgId = o.id";

        List<List<?>> res = personCache.query(new SqlFieldsQuery(sql).setDistributedJoins(true)).getAll();

        print(msg);

        for (Object next : res)
            System.out.println(">>>     " + next);
    }

我真的希望避免这种情况,并使用本机SQL.

I really wish to avoid this, and use native SQL.

是否还有其他可能的解决方案,可以使用第三方持久性和缓存来实现加入

Is there any other possible solutions to achieve joins using the 3rd party persistence and cache

谢谢

推荐答案

创建缓存时,可以将其sqlSchema设置为"PUBLIC".如果对所有缓存都执行此操作,则无需显式指定其架构(如果这正是您要解决的问题).

When creating a cache, you can set its sqlSchema to "PUBLIC". If you do that for all caches, you will never need to specify their schemas explicitly (if that's what your question was about).

这篇关于在基于旧版Java sql的项目中集成apache ignite的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆