【发布时间】:2020-08-29 21:50:43
【问题描述】:
我有一个从 DataType 实体扩展而来的产品实体。像这样:
@
Entity(name = "Product")
@Getter
@Setter
public class ProductEntity extends DataTypeEntity{
public Date created;
String name;
String url;
String code;
String description;
String fixedCost;
}
@Getter
@Setter
@NoArgsConstructor
public class DataTypeEntity {
@Id
public Long id;
public Date created;
public Date lastUpdated;
}
我有 ProductDao 从数据库中检索产品
@Repository
public interface ProductDao extends DatastoreRepository<ProductEntity, Long> {
List<ProductEntity> findAll();
List<ProductEntity> findByCode(String code);
当我进行查询时。 ID 为空。
Click here to see the screenshot of the query
我的 Google Cloud 数据存储实体如下所示: Click here to see the screenshot of datastore entity
我想找回钥匙 此实体的产品 ID:5748154649542656。请帮忙。 提前致谢
【问题讨论】:
标签: java spring-boot google-cloud-datastore spring-cloud-gcp