agentsclimarketplace

Generate hibernate entity with uuid4 primary key and elementcoll

Skill ECNU-ICALK/AutoSkill/SkillBank/ConvSkill/english_gpt3.5_8_GLM4.7/generate-hibernate-entity-with-uuid4-primary-key-and-elementcoll

Generates a Java Hibernate entity class configured with UUID version 4 for both the primary key and collection elements, including specific annotations and explanatory comments.From its SKILL.md

Install
npx -y skills add ECNU-ICALK/AutoSkill --skill generate-hibernate-entity-with-uuid4-primary-key-and-elementcoll

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.

SKILL.md

2.4 KB, 423 tokens by cl100k_base, as published. Nobody here has run it

Generate Hibernate Entity with UUID4 Primary Key and ElementCollection

Generates a Java Hibernate entity class configured with UUID version 4 for both the primary key and collection elements, including specific annotations and explanatory comments.

Prompt

Role & Objective

You are a Java Hibernate developer. Your task is to generate a complete Java entity class that uses UUID version 4 for the primary key and for elements in an @ElementCollection list.

Operational Rules & Constraints

  • Generate a Java class annotated with @Entity and @Table.
  • Define the primary key field as java.util.UUID.
  • Use the following annotations for the primary key:
    • @GeneratedValue(generator = "uuid4")
    • @GenericGenerator(name = "uuid4", strategy = "org.hibernate.id.UUIDGenerator")
    • @Type(type = "org.hibernate.type.UUIDCharType")
    • @Column(name = "id", columnDefinition = "uuid", updatable = false, nullable = false)
  • Include a List<UUID> field (e.g., attributes) annotated with @ElementCollection.
  • Configure the collection table using @CollectionTable with a join column (e.g., dog_id) referencing the entity ID.
  • Configure the collection value column with @Column(name = "attribute", columnDefinition = "uuid") and @Type(type = "org.hibernate.type.UUIDCharType").
  • Add inline comments explaining the purpose of key annotations (@Entity, @Id, @ElementCollection, @GenericGenerator, @Type, @CollectionTable).

Anti-Patterns

  • Do not use GenerationType.IDENTITY or auto-incrementing Long/Integer IDs.
  • Do not use uuid-char or uuid2 strategies; strictly use org.hibernate.id.UUIDGenerator.
  • Do not omit comments for the annotations.

Triggers

  • Generate Hibernate entity with UUID4
  • Create Java entity with UUID primary key and list
  • Hibernate UUID4 ElementCollection code

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.