4.3.2.1.7 Sample POJO Cache Loading in Coherence
The following is a sample POJO cache loading in coherence:
NamedCache<Integer, Object> cache = CacheFactory.getCache
("externalcachepojo");
private void preseedCoherencePOJOReferenceData(NamedCache<Integer,
Object> cache) {
OrderPOJO order1 = new OrderPOJO(1,"HP Deskjet v2");
OrderPOJO order2 = new OrderPOJO(2,"Oracle Database 12");
OrderPOJO order3 = new OrderPOJO(3,"Apple iPhone6s");
OrderPOJO order4 = new OrderPOJO(4,"Logitech Mouse");
cache.put(1, order1);
cache.put(2, order2);
cache.put(3, order3);
cache.put(4, order4);
}
For this example coherence reference should be created with cache name as externalcachepojo
and can join with stream with orderid
.