cassandra-driver-mapping:InvalidTypeException:无效的32位浮点值,期望4个字节但得到6个

时间:2016-12-13 02:10:32

标签: spring-boot cassandra mapping datastax

由于spring-data-cassandradocker作为描述符here出现问题,我转而使用com.datastax.cassandra库进行cassandra操作,但是在使用{根据此link

entity mapper

这是我的代码......

public String getUser(String userName) {
    Mapper<User> mapper = manager.mapper(User.class);
    User result = mapper.get(userName);  // no issue getting User
    String accountNum = result.getAccountId();
    return accountNum ;
}

public Account getAccount(String accountNum){
    Mapper<Account> mapper = manager.mapper(Account.class);
    Account account = mapper.get(accountNum); // getting error here
    return account;
}

Account.java

@Table(name = "account")
public class Account {
    @PartitionKey
    private String accountNum;
    private String accountsubtype;
    private float currentbalance;
    private String customertype;
    private String firstname;
    private boolean isactive;
    private String payments;
    private String status;
    ....
    //Getters & Setters 
}

pom.xml dependecies

<dependency>
    <groupId>com.datastax.cassandra</groupId>
    <artifactId>cassandra-driver-core</artifactId>
    <version>3.0.0</version>
</dependency>
<dependency>
    <groupId>com.datastax.cassandra</groupId>
    <artifactId>cassandra-driver-mapping</artifactId>
    <version>3.0.0</version>
</dependency>

0 个答案:

没有答案