Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

intent: own-side agree on a self-reference (agree [Parent, Project] onProperty: Project) generates a reverse guard that does not compile - ProjectEntity.Project

Đang mở
#7,989 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
47/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
java
Lĩnh vực
backend, testing

Hướng nghiên cứu

Start by reading the generator code that emits the reverse junction guard for own-side agree relations, then inspect the generated ProjectRepository.java example in the issue. Reproduce the failure with the ProjectTask self-reference YAML and confirm the generated Java fails to compile because ProjectEntity has no Project property. Done means parsing rejects this combination or the generated guard compiles and checks Parent.Project == Project on user writes.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Problem

An own-side agree (#7631) on a self-reference generates Java that does not compile, and the whole module then fails to load.

- name: ProjectTask
  checks:
    - { kind: agree, relations: [Parent, Project], onProperty: Project,
        message: "The parent task belongs to a different project" }
  relations:
    - { name: Project, kind: manyToOne, to: Project, composition: true, required: true }
    - { name: Parent, kind: manyToOne, to: ProjectTask }

The intent means "a sub-task's parent is in the same project" (Parent.Project == Project). Generate returns 200 and the parse is clean. The reverse ("junction") guard, however, is emitted into ProjectRepository, the target of the own-side relation Project:

// gen/projects/data/project/ProjectRepository.java
private static java.util.Map<String, Object> agreedValues(ProjectEntity entity) {
    values.put("Project", entity.Project);   // ProjectEntity has no Project

On 14.95.0 this gives javac error ... ProjectRepository.java:490:37: cannot find symbol. Every unit that touches ProjectRepository then fails too (48 units in BusinessIntents/base-projects + base-timesheets), and every controller of the module is unregistered.

The own-side form works on a plain relation, for example agree [Project, Company] onProperty Company on Milestone, where the reverse guard reads ProjectEntity.Company. It breaks when onProperty names the record's own relation (Project). That relation is a property of the record itself, not of the target, so the reverse guard should not be generated for it at all, or it should be keyed on a property the target actually has.

Expected

  • Parse refuses the combination, or the generator emits a guard that compiles.
  • Parent.Project == Project is checked on every user write (400).

Found by

BusinessIntents/base-projects#38 (train 14.95.0). The module works around it with a hand-written guard.

Ngôn ngữ chính
Java
Star
278
Fork
97
Merge trung bình
16 giờ 46 phút
Pull request đã merge (30 ngày)
265

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của eclipse-dirigible/dirigible

Tất cả issue của eclipse-dirigible/dirigible

Issue tương tự

Thêm issue về Java

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.