春季启动数据卡桑德拉
CQL:
CREATE TABLE device_data (
device_id uuid,
time timeuuid,
unit text,
value double,
PRIMARY KEY (device_id, time)
)
存储库:
public interface DeviceDataRepository extends CassandraRepository<DeviceData> {
@Query("SELECT * FROM device_data WHERE device_id = ?0 AND time > ?1")
List<DeviceData> findByDeviceIdAndTime(UUID deviceId, Date from);
}
用法:
Calendar calendar = new GregorianCalendar(1990, 1, 1);
List<DeviceData> pump1Data = deviceDataService.findByDeviceIdAndFrom(UUID.fromString(pumpid), calendar.getTime());
这给了我以下错误:
Invalid INTEGER constant (633826800000) for "time" of type timeuuid; nested exception is com.datastax.driver.core.exceptions.InvalidQueryException: Invalid INTEGER constant (633826800000) for "time" of type timeuuid
我究竟做错了什么?