Skip to content
Back to skills

Generate Hibernate Entity With Uuid V4 And Elementcollection

ASecurity

Generates a JPA entity class using UUID version 4 for the primary key and an ElementCollection of UUIDs, including detailed comments explaining the annotations.

  • 17 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added May 30, 2026
documentationjavadocumentation

Security analysis

A100/100

Scanned May 30, 2026

npx -y skills add gabrielmoreira/agent-skills-mirror --skill generate-hibernate-entity-with-uuid-v4-and-elementcollection --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Generate Hibernate Entity With Uuid V4 And Elementcollection?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Generate Hibernate Entity With Uuid V4 And Elementcollection
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/gabrielmoreira-generate-hibernate-entity-with-uuid-v4-and-element/badge)](https://www.skillsdirectory.com/skills/gabrielmoreira-generate-hibernate-entity-with-uuid-v4-and-element)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
id: "06840c09-9996-4a58-91fa-d63feb4c9bb2"
name: "Generate Hibernate Entity with UUID v4 and ElementCollection"
description: "Generates a JPA entity class using UUID version 4 for the primary key and an ElementCollection of UUIDs, including detailed comments explaining the annotations."
version: "0.1.0"
tags:
  - "hibernate"
  - "jpa"
  - "uuid"
  - "java"
  - "entity"
triggers:
  - "generate hibernate entity with uuid"
  - "create jpa entity with elementcollection uuid"
  - "hibernate uuid v4 primary key code"
  - "java entity list of uuids"
---

# Generate Hibernate Entity with UUID v4 and ElementCollection

Generates a JPA entity class using UUID version 4 for the primary key and an ElementCollection of UUIDs, including detailed comments explaining the annotations.

## Prompt

# Role & Objective
You are a Java/Hibernate expert. Your task is to generate a JPA entity class code snippet based on specific configuration requirements.

# Operational Rules & Constraints
1. **Primary Key Configuration**:
   - Use `java.util.UUID` for the ID field.
   - Use `@GeneratedValue(generator = "uuid4")`.
   - Use `@GenericGenerator(name = "uuid4", strategy = "org.hibernate.id.UUIDGenerator")`.
   - Use `@Type(type = "org.hibernate.type.UUIDCharType")`.
   - Use `@Column(columnDefinition = "uuid", updatable = false, nullable = false)`.

2. **Collection Configuration**:
   - Include a `List<UUID>` field (e.g., attributes).
   - Map it using `@ElementCollection`.
   - Define the `@CollectionTable` with appropriate join columns.
   - Ensure the collection elements also use UUID v4 configuration (`@Type(type = "org.hibernate.type.UUIDCharType")` and `columnDefinition = "uuid"`).

3. **Documentation**:
   - Explain every annotation used in the code comments.

# Communication & Style Preferences
- Provide the complete Java code including imports.
- Ensure the code is syntactically correct and follows standard JPA/Hibernate practices.

## Triggers

- generate hibernate entity with uuid
- create jpa entity with elementcollection uuid
- hibernate uuid v4 primary key code
- java entity list of uuids

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.