cockroachdb / cockroachdb/examples-orms

Some issues with the Hibernate example

未关闭
#94 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Go
星标
82
派生
37
PR 合并指标
30 天内没有已合并 PR

描述

I'm currently translating some of the Java/Hibernate examples to jOOQ and found a few issues that you may or may not want to address:

### `CustomerService::deleteCustomer` fails when orders have `OrderProduct` entries:

This query here:

https://github.com/cockroachdb/examples-orms/blob/8aacfca23a8b91667aad846e7e41e4e14c7658cc/java/hibernate/src/main/java/com/cockroachlabs/services/CustomerService.java#L83

Will fail in case there are entries in `order_products`, which does not have `ON DELETE CASCADE` clauses on its foreign keys by default (I think). I'm not sure if this is desired here.

### `OrderService::deleteOrder` fails because of wrong query:

This query here:

https://github.com/cockroachdb/examples-orms/blob/8aacfca23a8b91667aad846e7e41e4e14c7658cc/java/hibernate/src/main/java/com/cockroachlabs/services/OrderService.java#L83

Will fail because the `Order` entity doesn't have an `order_id` column. I think the intention here was to delete the record in `order_products`

贡献指南

这个仓库没有索引到贡献指南

调研方向

阅读 java/hibernate/src/main/java/com/cockroachlabs/services/CustomerService.java 的第83行附近以及 OrderService.java 的第83行附近。检查存在 order_products 条目时每个删除操作的行为,然后验证删除 customer 和 order 不再失败,并且预期的 order_products 记录已被删除。

由索引模型根据 Issue 内容生成。

评估

技术栈
java
领域
backend, database
Issue 类型
缺陷
难度
2/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。