MongoDB-Cannot autogenerate id of type java.lang.Long for entity of type
错误org.springframework.dao.InvalidDataAccessApiUsageException: Cannot autogenerate id of type java.lang.Long for entity of type com.xxxx.xxxx.xxx.api.mongoentity.xxxx!at org.springframework.data.mongod
·
错误
org.springframework.dao.InvalidDataAccessApiUsageException: Cannot autogenerate id of type java.lang.Long for entity of type com.xxxx.xxxx.xxx.api.mongoentity.xxxx!
at org.springframework.data.mongodb.core.EntityOperations$MappedEntity.assertUpdateableIdIfNotSet(EntityOperations.java:614) ~[spring-data-mongodb-3.2.3.jar:3.2.3]
at org.springframework.data.mongodb.core.MongoTemplate.doInsertBatch(MongoTemplate.java:1335) ~[spring-data-mongodb-3.2.3.jar:3.2.3]
at org.springframework.data.mongodb.core.MongoTemplate.insert(MongoTemplate.java:1280) ~[spring-data-mongodb-3.2.3.jar:3.2.3]
解决方案
参考
Spring data mongodb. Generating id’s error
https://stackoverflow.com/questions/26574409/spring-data-mongodb-generating-ids-error
更多推荐
所有评论(0)