2016-05-26 56 views
0

我正试图在工作过程中将日志记录写入表中。不幸的是,尽管表中存在(通过查询使用JDBC客户端表确认),昆德拉不相信它的存在,投掷:昆德拉Unconfigured ColumnFamily尽管ColumnFamily存在

com.impetus.kundera.configure.schema.SchemaGenerationException: 
InvalidRequestException(why:unconfigured columnfamily ingestionBatchSummary) 

这是我的persistence.xml:

<persistence-unit name="cassandra_pu"> 
    <provider>com.impetus.kundera.KunderaPersistence</provider> 
    <properties> 
     <property name="kundera.client.lookup.class" 
      value="com.impetus.kundera.client.cassandra.dsdriver.DSClientFactory" /> 
     <property name="kundera.ddl.auto.prepare" value="validate" /> 
    </properties> 
</persistence-unit> 

随着属性文件,我从当我创建了EntityManager加载(加载ApplicationConfiguration.getProperties()):

kundera.nodes=127.0.0.1 
kundera.port=9042 
kundera.keyspace=migration 
kundera.username=notsecret 
kundera.password=supersecret 

而且我的实体:

@Entity 
@Table(name="ingestionBatchSummary") 
public class BatchSummary { 
    @Id 
    @Column(name="batchUuid") 
    private UUID batchUUID; //UUID of Batch 

    @Column(name="stuff") 
    private String stuff; //log contents 

    //Getters, setters 
} 

和魔线抛出我的错误:

EntityManagerFactory emfactory = Persistence.createEntityManagerFactory("cassandra_pu", 
        ApplicationConfiguration.getProperties()); 

我已经证实了密钥空间和表通过查询他们存在,我已经证实,属性与服务器匹配,我已经确认这些属性已正确加载(成功连接和密钥空间出现在日志中)。昆德拉可能没有认识到这张桌子的存在是否有其他原因?

回答

1

想通了我的问题:该表是用CREATE TABLE IngestionBatchSummary而不是CREATE TABLE "IngestionBatchSummary"创建的。结果,该表格以全部小写名称存在。我错过了这个事实,因为我的JDBC查询也没有包含引号,而昆德拉的查询显然是这样。

相关问题