|
| 1 | +<!-- DISCARD_BLOCK: phase_modeling --> |
| 2 | + |
| 3 | +# TeaQL Java Agent Instructions |
| 4 | + |
| 5 | +> [!WARNING] |
| 6 | +> **IGNORE GENERIC ORM EXPERIENCE** |
| 7 | +> |
| 8 | +> Do **not** use pre-trained habits from data-access frameworks, ORMs, or database integration libraries. |
| 9 | +> |
| 10 | +> Do **not** use MyBatis, JPA, Hibernate, Spring Data, MyBatis-Plus, or similar frameworks. |
| 11 | +> |
| 12 | +> Do **not** write raw SQL, DAOs, Repository implementations, or custom persistence layers. |
| 13 | +> |
| 14 | +> Do **not** guess TeaQL method names. |
| 15 | +
|
| 16 | +## How to Write Domain Code |
| 17 | + |
| 18 | +To get the exact API usage and query examples for the entity you are working on, execute the following command: |
| 19 | + |
| 20 | +```bash |
| 21 | +cargo teaql --input models/school-management-service.xml java-assist-[action]/[entity-name] |
| 22 | +``` |
| 23 | + |
| 24 | +> `models/school-management-service.xml` is the default model path. If the model file is located elsewhere, adjust the `--input` path to match the actual file location in this project. |
| 25 | +
|
| 26 | +Replace `[action]` with one of the following: |
| 27 | + |
| 28 | +| action | when-to-use | |
| 29 | +|--------|-------------| |
| 30 | +| query | Read/find records from the database using Q. | |
| 31 | +| create | Insert a new record into the database | |
| 32 | +| update | Modify and save an existing record | |
| 33 | +| delete | Remove or soft-delete a record | |
| 34 | +| expression | Safely extract nested relation values using E. | |
| 35 | +| list-page | Implement a paginated query returning SmartList | |
| 36 | +| debug | View instructions for enabling SQL logging and debugging | |
| 37 | + |
| 38 | +Replace `[entity-name]` with the exact entity-name from the table below: |
| 39 | + |
| 40 | +| entity-name | display-name | |
| 41 | +|-------------|--------------| |
| 42 | +| platform | Platform | |
| 43 | +| school_type | School Type | |
| 44 | +| school | School | |
| 45 | + |
| 46 | + |
| 47 | +Once the command succeeds, read its output. Use the printed code as a template to write your logic. |
| 48 | + |
| 49 | +If the command cannot be executed, stop and report the missing context. Do not invent APIs. |
| 50 | + |
| 51 | +## Additional References |
| 52 | + |
| 53 | +Read these only when the task requires them: |
| 54 | + |
| 55 | +* **`TOOL_API_GUIDE.md`** |
| 56 | + Framework runtime references and context handling. |
| 57 | + |
| 58 | +* **`RUNTIME_CUSTOM_GUIDE.md`** |
| 59 | + Runtime setup, debugging, and project-specific restrictions. |
0 commit comments