You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by Ajay <aj...@6dtech.co.in> on 2017/07/21 09:04:45 UTC

Cache Store in Ignite2.0

Hi All,
 
how to load fields into cache which was not part of POJO when we doing
read-through from DB.

Example:

Table: Id|Name|Salary
Pojo: Id|Name

In above example pojo having only id and name but not salary, if i want to
store salary also do we need to maintain salary also in the pojo or ?
because when we are using jdbc in ignite we can put all the fields(which not
part of pojo) in map tag like

<property name="fields">
	<map>
		<entry key="id" value="java.lang.Long"/>
		<entry key="msidn" value="java.lang.String"/>
		<entry key="salary" value="java.lang.Long"/>
	</map>
</property>

same case how we can mange when we are doing read-through from DB.

Thanks,
Ajay.


								
 



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Cache-Store-in-Ignite2-0-tp15227.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Cache Store in Ignite2.0

Posted by vkulichenko <va...@gmail.com>.
SQL schema is currently not dynamic. I.e. you can dynamically add field to
binary object, but it can't be used in queries. In future we will support
ALTER TABLE syntax that will allow to do this.

-Val



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Cache-Store-in-Ignite2-0-tp15227p15265.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Cache Store in Ignite2.0

Posted by Ajay <aj...@6dtech.co.in>.
Hi,

Example:

I want to build a person cache here my key was affinity key and value was
person object assume like my person object having only id,name at run time i
want to keep salary also into my cache i saw in ignite we can add fields
dynamically at run time like in map tag i pasted above so using ignite jdbc
when insert like /insert into person(_key,id,name,salary)values(......)/ we
are getting success and same when we can select like /select id,salary from
person where name=xxxxx/ also success.

Case:
How i need to keep salary into my cache(CacheStore logic) when i am doing
read through from DB ?

Thanks,
Ajay.



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Cache-Store-in-Ignite2-0-tp15227p15260.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Cache Store in Ignite2.0

Posted by vkulichenko <va...@gmail.com>.
This looks like a part of QueryEntity configuration which is related to
Ignite SQL, not to persistence. Can you clarify what you want to achieve,
show full configuration, and explain what exactly is not working?

-Val



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Cache-Store-in-Ignite2-0-tp15227p15259.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Cache Store in Ignite2.0

Posted by Ajay <aj...@6dtech.co.in>.
Hi,

In ignite jdbc execution if filed is not present in value type and if we
keep that filed in map, how ignite taking care of this fields.

<property name="fields">
        <map>
                <entry key="id" value="java.lang.Long"/>
                <entry key="msidn" value="java.lang.String"/>
                <entry key="salary" value="java.lang.Long"/>
        </map>
</property>


Thanks,
Ajay.



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Cache-Store-in-Ignite2-0-tp15227p15235.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Cache Store in Ignite2.0

Posted by ezhuravlev <e....@gmail.com>.
Hi,

If you want, you can work without POJO at all. It's possible to work wih
BinaryObjects: https://apacheignite.readme.io/docs/binary-marshaller

Here is working example:
http://apache-ignite-users.70518.x6.nabble.com/SQL-queries-with-BinaryObject-td5636.html

Evgenii



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Cache-Store-in-Ignite2-0-tp15227p15230.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.