ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mrinalkamboj <mrinal.technol...@gmail.com>
Subject Define QuerySqlField in the config file instead of C# code
Date Wed, 08 Mar 2017 06:04:26 GMT
This is how I declare an entity in C#, which needs to be persisted in the

public class OrderEntity
    [QuerySqlField(IsIndexed = true)]
    public int OrderId { get; set; }

    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 name="OrderCache" cacheMode="Replicated"
        <cacheStoreFactory type="OrderCacheStoreFactory,ApacheIgnite"/>        
          <queryEntity keyType="System.Int32"
valueType="OrderEntity,ApacheIgnite" keyTypeName="OrderId"
          <queryEntity keyType="System.String"
valueType="OrderEntity,ApacheIgnite" keyTypeName="OrderName"

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.

View raw message