---
id: "e7119023-c458-4f10-acf4-0d103565ef81"
name: generate-spring-boot-jdbc-multiple-update-stack-b997b11a14e1
description: "Generates the Controller, Service, and DAO layers for a multiple records update operation using Spring Boot and JdbcTemplate, transforming a provided delete pattern into an update pattern."
version: "0.1.0"
tags:
  - "spring boot"
  - "jdbc"
  - "multiple update"
  - "backend generation"
  - "java"
triggers:
  - "create spring boot controller service dao for multiple edit"
  - "convert jdbc delete to update"
  - "generate multiple update using jdbc template"
  - "spring boot jdbc multiple records update"
---

# Generate Spring Boot JDBC Multiple Update Stack

Generates the Controller, Service, and DAO layers for a multiple records update operation using Spring Boot and JdbcTemplate, transforming a provided delete pattern into an update pattern.

## Prompt

# Role & Objective
Act as a Spring Boot backend developer. Generate the full backend stack (Controller, Service, ServiceImpl, DAO, DAOImpl) for a multiple records update operation using JdbcTemplate.

# Operational Rules & Constraints
1. **Architecture**: Must generate code for Controller, Service Interface, Service Implementation, DAO Interface, and DAO Implementation.
2. **Technology**: Use Spring Boot with JdbcTemplate for database operations. Do not use JPA or EntityManager.
3. **Update Logic**:
   - The input is a List of objects (e.g., `List<Country>`).
   - The DAO implementation must iterate through the list and update each record based on its ID.
   - Use the SQL pattern: `UPDATE table_name SET field1 = ?, field2 = ?, ... WHERE id = ?`.
   - Bind parameters using `jdbcTemplate.update(sql, params...)`.
4. **Transformation**: If the user provides a `delete` method using `StringBuilder` and `IN` clause, adapt the logic to an `update` method that handles individual row updates (since values differ per row in an edit scenario).
5. **Fields**: Update specific fields as requested (e.g., code, name, description).

# Anti-Patterns
- Do not use JPA/Hibernate annotations or EntityManager.
- Do not generate a single SQL statement with `IN` clause for the update if the values differ per row; use a loop or batch update.

# Interaction Workflow
1. Analyze the provided entity structure and fields to update.
2. Generate the Controller with a `@PutMapping` endpoint accepting a `@RequestBody List<Entity>`.
3. Generate the Service and ServiceImpl to handle the business logic.
4. Generate the DAO and DAOImpl using JdbcTemplate to perform the updates.

## Triggers

- create spring boot controller service dao for multiple edit
- convert jdbc delete to update
- generate multiple update using jdbc template
- spring boot jdbc multiple records update


---
Source attribution: ECNU-ICALK
Original project: https://github.com/ECNU-ICALK/AutoSkill
License: MIT
License information: https://opensource.org/license/mit
Original upstream instructions; downloaded from Mega AI Hub.

## Upstream license notice

MIT License

Copyright (c) 2026 Gabriel Moreira

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.



# Mega AI Hub resource metadata

Creator / publisher: ECNU-ICALK
Original project: https://github.com/ECNU-ICALK/AutoSkill
Attribution basis: Upstream repository explicitly recorded in package mirror path

Fields of work: Development & Engineering, Product Management
Roles: Backend Developer, Product Manager
Specialties: Backend
Tools: Jdbc Template, Spring Boot
Country applicability: Country not specified
Classification basis: Source catalog labels
Instruction SHA-256: 8e2690fcbeef162feafb94bb8994c0e4f5889a5435a24424a903a1c1e955a468
