Hi Ilya,

Thank you for your advice. It does work now when I put my class as the
javaFieldType. However one thing still does bother me. 

Previously you advised that Ignite will determine itself if the enum is
ORDINAL or a STRING and store accordingly - either Ordinal or the Name.

So I have accordingly mapped 2 fields - one as Integer and one as String.

<bean class="org.apache.ignite.cache.store.jdbc.JdbcTypeField">
  <property name="databaseFieldType" >
          <util:constant static-field="java.sql.Types.INTEGER"/>
  </property>
  <property name="databaseFieldName" value="state" />
  <property name="javaFieldType" value="com.myModel.CState" />
  <property name="javaFieldName" value="state" />
</bean>         


<bean class="org.apache.ignite.cache.store.jdbc.JdbcTypeField">
  <property name="databaseFieldType" >
          <util:constant static-field="java.sql.Types.VARCHAR"/>
  </property>
  <property name="databaseFieldName" value="type" />
  <property name="javaFieldType" value="com.myModel.CType" />
  <property name="javaFieldName" value="type" />
</bean>         

Here is my SQLServer Table:

CREATE TABLE [dbo].[CCache1](
        [ric] [varchar](255) NOT NULL,
        [state] [int] null,
        [type] [varchar](255) null
)

The problem is that no matter if I map the ENUM to Integer or String - it
always stores it as Integer, even in Varchar column. Please advise.

Please see the SQLServer results after storing data in Ignite:
select top 100 ric, state, type from [CCache1]
ric     state   type
.CSUS0457       1       20



Thanks,
Michal



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Reply via email to