问题
I have a legacy java project where I have more than 1000 table and a lot of SQL queries.
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);
}
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
Thanks
回答1:
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).
来源:https://stackoverflow.com/questions/58928903/integrating-apache-ignite-in-legacy-java-sql-based-project-joins-issue