/** */ public JdbcType getJdbcType() { JdbcType type = new JdbcType(); type.setCacheName("TEST_CACHE"); type.setKeyType(Integer.class); type.setValueType(TestPojo.class); type.setDatabaseSchema("PUBLIC"); type.setDatabaseTable("TEST_CACHE"); type.setKeyFields(new JdbcTypeField(java.sql.Types.INTEGER, "VALUE2", Integer.class, "value2")); type.setValueFields( new JdbcTypeField(java.sql.Types.VARCHAR, "VALUE1", String.class, "value1"), new JdbcTypeField(java.sql.Types.DATE, "VALUE3", java.sql.Date.class, "value3") ); return type; }
storeTypes[0].setValueFields( new JdbcTypeField(Types.INTEGER, "ID", Integer.class, "id"), new JdbcTypeField(Types.VARCHAR, "NAME", String.class, "name"), storeTypes[1].setValueFields( new JdbcTypeField(Types.INTEGER, "ID", Integer.class, "id"), new JdbcTypeField(Types.INTEGER, "ORG_ID", Integer.class, "orgId"), storeTypes[2].setValueFields( new JdbcTypeField(Types.INTEGER, "ID", Integer.class, "id"), new JdbcTypeField(Types.INTEGER, "ORG_ID", Integer.class, "orgId"), storeTypes[3].setValueFields(new JdbcTypeField(Types.INTEGER, "VAL", Integer.class, null)); storeTypes[4].setValueFields(new JdbcTypeField(Types.VARCHAR, "VAL", Integer.class, null)); storeTypes[5].setValueFields(new JdbcTypeField(Types.BINARY, "VAL", UUID.class, null)); storeTypes[6].setValueFields(new JdbcTypeField(Types.BINARY, "VAL", byte[].class, "bytes"));
storeTypes[0].setValueFields( new JdbcTypeField(Types.INTEGER, escape ? "ID" : "Id", Integer.class, "id"), new JdbcTypeField(Types.VARCHAR, escape ? "NAME" : "Name", String.class, "name"), storeTypes[1].setValueFields( new JdbcTypeField(Types.INTEGER, "ID", Integer.class, "id"), new JdbcTypeField(Types.INTEGER, "ORG_ID", Integer.class, "orgId"),
/** * Create JDBC type for Person. * * @param cacheName Cache name. * @return Configured JDBC type. */ private static JdbcType jdbcTypePerson(String cacheName) { JdbcType jdbcType = new JdbcType(); jdbcType.setCacheName(cacheName); jdbcType.setDatabaseSchema("PUBLIC"); jdbcType.setDatabaseTable("PERSON"); jdbcType.setKeyType("org.apache.ignite.PersonKey"); jdbcType.setValueType("org.apache.ignite.Person"); jdbcType.setKeyFields( new JdbcTypeField(Types.NUMERIC, "ID", long.class, "id") ); jdbcType.setValueFields( new JdbcTypeField(Types.VARCHAR, "FIRST_NAME", String.class, "firstName"), new JdbcTypeField(Types.VARCHAR, "LAST_NAME", String.class, "lastName"), new JdbcTypeField(Types.DOUBLE, "SALARY", Double.class, "salary") ); return jdbcType; }