如何限制我的pojo列成为Ignite表的一部分

时间:2019-04-18 11:37:40

标签: ignite cassandra-3.0

我有一个pojo,用于创建点火缓存。现在,我想在该pojo中再添加一列(XXX),并且不希望该列(XXX)成为ignite缓存创建的一部分。

原因:类org.apache.ignite.IgniteException:无法准备Cassandra CQL语句:选择“ customer_ref”,“ tenant_id”,“ event_discount_id”,“ period_num”,“ domain_id”,“ event_source”,“ prod_group_id” ,“ event_seq”,“ product_seq”,“ online_version_num”,“ total_authorised_mny”,“ version_num”,“ bonus_count”,“ customer_category”,“ 恢复状态 ”,“ total_discounted_usage” ,“ external_balance_liid”,“ total_online_discounted_mny”,“ anti_event_disc_mny”,“ total_partials_mny”,“ counter_usage”,“ total_partials_usage”,“ online_event_count”,“ event_count”,“ last_rated_dyn”,“ account_dnt”,“ total_usage”,“ anti_event_count”,“ last_online_event_dtm”,“ fast_cache_seq”,“ total_discounted_mny”,“ latest_event_dtm”,“ total_online_discounted_usage”,“ carried_over_boo”,“ total_authorized_count_usage”,“ total_authorized_usage”,来自“聪明”。“ custprodinvoicediscusage”,其中“ cus tomer_ref“ =?和“ tenant_id” =?和“ event_discount_id” =?和“ period_num” =?和“ domain_id” =?和“ event_source” =?和“ prod_group_id” =?和“ event_seq” =?和“ product_seq” = ?;         在org.apache.ignite.cache.store.cassandra.session.CassandraSessionImpl.prepareStatement(CassandraSessionImpl.java:603)         在org.apache.ignite.cache.store.cassandra.session.CassandraSessionImpl.execute(CassandraSessionImpl.java:201)         ...另外12个 引起原因:com.datastax.driver.core.exceptions.InvalidQueryException:未定义的列名称recovery_status         在com.datastax.driver.core.exceptions.InvalidQueryException.copy(InvalidQueryException.java:50)         在com.datastax.driver.core.DriverThrowables.propagateCause(DriverThrowables.java:37)         在com.datastax.driver.core.AbstractSession.prepare(AbstractSession.java:104)         在org.apache.ignite.cache.store.cassandra.session.CassandraSessionImpl.prepareStatement(CassandraSessionImpl.java:585)         ...还有13个

2 个答案:

答案 0 :(得分:1)

ignite使用getter和setter方法读取和写入。

在该POJO中更改了此方法签名,而不是getXXX()和setXXX()

public void putRecovery_status (整数RECOVERY_STATUS){this.RECOVERY_STATUS = RECOVERY_STATUS; }

public Integer fetchRecovery_status (){返回RECOVERY_STATUS; }

答案 1 :(得分:0)

如果您不想使字段最终出现在Ignite缓存中,则可以将其标记为transient