Apache ignite:未找到列id。即使它在那里

Apache ignite:未找到列id。即使它在那里,ignite,Ignite,大家好,我在dBeaver控制台上收到一条消息。 在PK的表“BusinesslogicsCache.BUSINESSLOGICS”中找不到列“businesslogicid” 'BusinesslogicsCache.BUSINESSLOGICS.businesslogicid' 此businesslogicid位于缓存和缓存配置中 查询:- 选择LOGICNAME、CONFIGURATION、CREATEDON、MODIFIEDON、CREATEDBY、MODIFIEDBY、ISACTIVE

大家好,我在dBeaver控制台上收到一条消息。 在PK的表“BusinesslogicsCache.BUSINESSLOGICS”中找不到列“businesslogicid” 'BusinesslogicsCache.BUSINESSLOGICS.businesslogicid'

此businesslogicid位于缓存和缓存配置中

查询:-

选择LOGICNAME、CONFIGURATION、CREATEDON、MODIFIEDON、CREATEDBY、MODIFIEDBY、ISACTIVE、BUSINESSLOGICID 来自BusinesslogicsCache.BUSINESSLOGICS

带有jdbctypes的表配置

public static CacheConfiguration cacheBusinesslogicsCache() throws Exception {
        CacheConfiguration ccfg = new CacheConfiguration();

        ccfg.setName("BusinesslogicsCache");
        ccfg.setCacheMode(CacheMode.PARTITIONED);
        ccfg.setAtomicityMode(CacheAtomicityMode.ATOMIC);

    CacheJdbcPojoStoreFactory cacheStoreFactory = new CacheJdbcPojoStoreFactory();

    cacheStoreFactory.setDataSourceFactory(new Factory<DataSource>() {
        /** {@inheritDoc} **/
        @Override
        public DataSource create() {
            return DataSources.INSTANCE_dsMySQL_CcplatformQa;
        };
    });

    cacheStoreFactory.setDialect(new MySQLDialect());

    cacheStoreFactory.setTypes(jdbcTypeBusinesslogics(ccfg.getName()));

    ccfg.setCacheStoreFactory(cacheStoreFactory);

    ccfg.setReadThrough(true);
    ccfg.setWriteThrough(true);
    ccfg.setBackups(1);

    ArrayList<QueryEntity> qryEntities = new ArrayList<>();

    QueryEntity qryEntity = new QueryEntity();

    qryEntity.setKeyType("java.lang.Long");
    qryEntity.setValueType("org.netlink.ignite.model.Businesslogics");
    qryEntity.setKeyFieldName("businesslogicid");

    HashSet<String> keyFields = new HashSet<>();

    keyFields.add("businesslogicid");

    qryEntity.setKeyFields(keyFields);

    LinkedHashMap<String, String> fields = new LinkedHashMap<>();

    fields.put("logicname", "java.lang.String");
    fields.put("type", "java.lang.String");
    fields.put("configuration", "java.lang.String");
    fields.put("createdon", "java.sql.Timestamp");
    fields.put("modifiedon", "java.sql.Timestamp");
    fields.put("createdby", "java.lang.Long");
    fields.put("modifiedby", "java.lang.Long");
    fields.put("isactive", "java.lang.Boolean");
    fields.put("businesslogicid", "java.lang.Long");

    qryEntity.setFields(fields);

    ArrayList<QueryIndex> indexes = new ArrayList<>();

    QueryIndex index = new QueryIndex();

    index.setName("createdBy");
    index.setIndexType(QueryIndexType.SORTED);

    LinkedHashMap<String, Boolean> indFlds = new LinkedHashMap<>();

    indFlds.put("createdby", false);

    index.setFields(indFlds);
    indexes.add(index);

    index = new QueryIndex();

    index.setName("modifiedBy");
    index.setIndexType(QueryIndexType.SORTED);

    indFlds = new LinkedHashMap<>();

    indFlds.put("modifiedby", false);

    index.setFields(indFlds);
    indexes.add(index);

    qryEntity.setIndexes(indexes);
    qryEntities.add(qryEntity);

    ccfg.setQueryEntities(qryEntities);

    return ccfg;
}

/**
 * Create JDBC type for "jdbcTypeBusinesslogics".
 * 
 * @param cacheName Cache name.
 * @return Configured JDBC type.
 **/
private static JdbcType jdbcTypeBusinesslogics(String cacheName) {
    JdbcType type = new JdbcType();

    type.setCacheName(cacheName);
    type.setKeyType(Long.class);
    type.setValueType("org.netlink.ignite.model.Businesslogics");
    type.setDatabaseSchema(schema);
    type.setDatabaseTable("businesslogics");

    type.setKeyFields(new JdbcTypeField(Types.BIGINT, "businessLogicId", long.class, "businesslogicid"));

    type.setValueFields(new JdbcTypeField(Types.VARCHAR, "logicName", String.class, "logicname"),
            new JdbcTypeField(Types.VARCHAR, "type", String.class, "type"),
            new JdbcTypeField(Types.LONGVARCHAR, "configuration", String.class, "configuration"),
            new JdbcTypeField(Types.TIMESTAMP, "createdOn", Timestamp.class, "createdon"),
            new JdbcTypeField(Types.TIMESTAMP, "modifiedOn", Timestamp.class, "modifiedon"),
            new JdbcTypeField(Types.BIGINT, "createdBy", long.class, "createdby"),
            new JdbcTypeField(Types.BIGINT, "modifiedBy", long.class, "modifiedby"),
            new JdbcTypeField(Types.BIT, "isActive", boolean.class, "isactive"));

    return type;
}

请引导我

我认为您应该删除setKeyFields,因为只有当您的键不是基元类型时才需要它。

您能显示完整的语句和表配置吗?任何SQL实体名称中都不应包含两点。查询:=从BusinesslogicsCache.BUSINESSLOGICS中选择LOGICNAME、CONFIGURATION、CREATEDON、MODIFIEDON、CREATEDBY、MODIFIEDBY、ISACTIVE、BUSINESSLOGICID;Not基元类型表示数据库中列的数据类型。或者表示表的java pojo类中属性的数据类型。表示您的键类型:cache key。我删除了setkeyfields,但结果是相同的。当您选择*时,列名是什么?它们都是大写的