Re: link cache to object class?

2016-04-14 Thread Denis Magda
I'm not sure I understand you properly.

However in any case you can use a code block like the one below to get an
instance of a cache related to a specific class

String cacheName = object.getClass().getSimpleName().toLowerCase();

IgniteCache cache = ignite.cache(cacheName);

The caches have to be pre-configured with this names in XML configuration or
can be started dynamically with ignite.getOrCreateCache()

--
Denis



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/link-cache-to-object-class-tp4119p4211.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Re: link cache to object class?

2016-04-13 Thread Ravi kumar Puri
So i need to define jst d cache name in configuratn n nothng else as their
attributes .how can i wil be able to relate to class .. even i dnr need any
bean or class path/package in bean form to get name in ignite.xml
configuration
On 13-Apr-2016 17:36, "Denis Magda" <dma...@gridgain.com> wrote:

> Give a cache a name that is related to an objects simple class name.
>
> As an example, you have a class “Person”. Create the cache with the same
> name and get a reference to it using ignite.cache(“Person”)
>
> —
> Denis
>
> > On Apr 13, 2016, at 1:35 PM, Ravi Puri <ravikumarpur...@gmail.com>
> wrote:
> >
> > how can i link the cache created in configuration to the object class so
> that
> > i can decide which cache is for which class?
> >
> >
> >
> > --
> > View this message in context:
> http://apache-ignite-users.70518.x6.nabble.com/link-cache-to-object-class-tp4119.html
> > Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>
>


link cache to object class?

2016-04-13 Thread Ravi Puri
how can i link the cache created in configuration to the object class so that
i can decide which cache is for which class?



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/link-cache-to-object-class-tp4119.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.