Модель:
Код: Выделить всё
@Document(collection = "STORAGE_CLASS")
public class StorageClass {
@Field("STATUS")
private String status;
@Field("FIELD_NUMBER")
private long numberField;
... // getters, setters, tostring
}
Код: Выделить всё
public interface StorageClassDao {
List getStorage();
}
@Repository
public class StorageClassDaoImpl implements StorageClassDao {
private MongoTemplate mongoTemplate;
public StorageClassDaoImpl(MongoTemplate mongoTemplate) {
this.mongoTemplate = mongoTemplate;
}
@Override
public List getStorage() {
Criteria criteria = Criteria.where("STATUS").is("E")
.and("FIELD_NUMBER").is(1);
Query query = new Query(criteria);
return this.mongoTemplate.find(query, StorageClass.class);
}
}
Код: Выделить всё
No property 'STATUS' found for type 'StorageClass'
No property 'STATU' found for type 'StorageClass'
No property 'STAT' found for type 'StorageClass'
No property 'STA' found for type 'StorageClass'
No property 'ST' found for type 'StorageClass'
No property 's' found for type 'StorageClass'
No property 'FIELD' found for type 'StorageClass'
No property 'FIEL' found for type 'StorageClass'
No property 'FIE' found for type 'StorageClass'
No property 'FI' found for type 'StorageClass'
No property 'f' found for type 'StorageClass'
No property 'FIELD_NUMBER' found for type 'StorageClass'
No property 'FIELD_NUMBE' found for type 'StorageClass'
No property 'FIELD_NUMB' found for type 'StorageClass
No property 'FIELD_NUM' found for type 'StorageClass'
No property 'FIELD_NU' found for type 'StorageClass'
No property 'FIELD_N' found for type 'StorageClass''
No property 'FIELD_' found for type 'StorageClass'
Код: Выделить всё
Exception 'org.springframework.data.mapping.PropertyReferenceException' occurred in thread 'scheduling-1' at org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:490)
Exception 'org.springframework.data.mapping.PropertyReferenceException' occurred in thread 'scheduling-1' at org.springframework.data.mapping.PropertyPath.(PropertyPath.java:94)
Что я здесь делаю не так?
Код для справки: https://github.com/felipeissa/mongo-db-Exception
Версия загрузки Spring: 3.3.6
Версия данных Spring mongodb : 4.3.6
Версия Java: 21
Подробнее здесь: https://stackoverflow.com/questions/792 ... eexception
Мобильная версия