This is how I declare an entity in C#, which needs to be persisted in the
Cache:
*
[Serializable]
public class OrderEntity
{
[QuerySqlField(IsIndexed = true)]
public int OrderId { get; set; }
[QuerySqlField]
public string OrderName { get; set; }
}
*
The same entity, I want to propagate further in the application, for
processing once its fetched from the Cache, but the challenge is attribute
*[QuerySqlField]* needs Apache ignite reference, which then needs to
propagate to higher layers, which is undesirable, so only options are:
1. Either I can define these details in the config file, since they are
mandatory for Sql querying the entity.
Not sure if the same can be defined under *cacheConfiguration -
queryEntities* as follows
*
<cacheConfiguration>
<cacheConfiguration name="OrderCache" cacheMode="Replicated"
startSize="104857600">
<cacheStoreFactory type="OrderCacheStoreFactory,ApacheIgnite"/>
<queryEntities>
<queryEntity keyType="System.Int32"
valueType="OrderEntity,ApacheIgnite" keyTypeName="OrderId"
valueTypeName="OrderEntity"/>
<queryEntity keyType="System.String"
valueType="OrderEntity,ApacheIgnite" keyTypeName="OrderName"
valueTypeName="OrderEntity"/>
</queryEntities>
</cacheConfiguration>
</cacheConfiguration>
*
2. Define a separate business entity, do the explicit mapping post fetching
the Cache entity, which is the last option due to lot of extra work
--
View this message in context:
http://apache-ignite-users.70518.x6.nabble.com/Define-QuerySqlField-in-the-config-file-instead-of-C-code-tp11067.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.