AutoSkill 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.
install
source · Clone the upstream repo
git clone https://github.com/ECNU-ICALK/AutoSkill
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/ECNU-ICALK/AutoSkill "$T" && mkdir -p ~/.claude/skills && cp -r "$T/SkillBank/ConvSkill/english_gpt3.5_8/generate-hibernate-entity-with-uuid-v4-and-elementcollection" ~/.claude/skills/ecnu-icalk-autoskill-generate-hibernate-entity-with-uuid-v4-and-elementcollectio && rm -rf "$T"
manifest:
SkillBank/ConvSkill/english_gpt3.5_8/generate-hibernate-entity-with-uuid-v4-and-elementcollection/SKILL.mdsource content
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
-
Primary Key Configuration:
- Use
for the ID field.java.util.UUID - 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)
- Use
-
Collection Configuration:
- Include a
field (e.g., attributes).List<UUID> - Map it using
.@ElementCollection - Define the
with appropriate join columns.@CollectionTable - Ensure the collection elements also use UUID v4 configuration (
and@Type(type = "org.hibernate.type.UUIDCharType")
).columnDefinition = "uuid"
- Include a
-
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