# Metamodel generator / Processor loses generic type parameter for Set\<String\> in Hibernate 7

**URL:** <https://discourse.hibernate.org/t/metamodel-generator-processor-loses-generic-type-parameter-for-set-string-in-hibernate-7/12227>\
**Category:** Hibernate ORM\
**Created:** [April 29, 2026, 1:12pm UTC](https://discourse.hibernate.org/t/metamodel-generator-processor-loses-generic-type-parameter-for-set-string-in-hibernate-7/12227 "2026-04-29T13:12:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Renato\_Mameli](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/renato_mameli/32/3225_2.png) [@Renato\_Mameli](https://discourse.hibernate.org/u/Renato_Mameli)\
**Post date:** [April 29, 2026, 1:12pm UTC](https://discourse.hibernate.org/t/metamodel-generator-processor-loses-generic-type-parameter-for-set-string-in-hibernate-7/12227/1 "2026-04-29T13:12:06Z")

</div>

In Hibernate 6, a field annotated with `@Column @NotNull private Set<String> issueTypeLabels` mapped to a Postgres `VARCHAR ARRAY` column generated:

```java
public static volatile SingularAttribute<TestEntity, Set<String>> issueTypeLabels;

```

In Hibernate 7 with our without `@JdbcTypeCode(SqlTypes.ARRAY)` added, the generator produces a raw type:

```java
public static volatile SingularAttribute<TestEntity, Set> issueTypeLabels;

```

**Steps to reproduce:** Entity field with `@JdbcTypeCode(SqlTypes.ARRAY)` and `Set<String>` type.

**Expected:** `SingularAttribute<TestEntity, Set<String>>`

**Actual:** `SingularAttribute<TestEntity, Set>` (raw type)

Example:

```java
@MappedSuperclass
public abstract class BaseEntity implements Serializable {

    @Id
    private UUID id = UUID.randomUUID();

    public UUID getId() {
        return id;
    }

    public void setId(UUID id) {
        this.id = id;
    }
}

```

```java
@Entity
public class TestEntity extends BaseEntity {

    @Column
    @JdbcTypeCode(SqlTypes.ARRAY)
    private Set<String> tags = new HashSet<>();

    @Column
    private String name;

    public Set<String> getTags() {
        return tags;
    }

    public void setTags(Set<String> tags) {
        this.tags = tags;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}

```

```java
/**
 * Static metamodel for {@link com.example.hibernateissue.TestEntity}
 **/
@StaticMetamodel(TestEntity.class)
@Generated("org.hibernate.processor.HibernateProcessor")
public abstract class TestEntity_ extends BaseEntity_ {

    
    /**
     * @see #tags
     **/
    public static final String TAGS = "tags";
    
    /**
     * @see #name
     **/
    public static final String NAME = "name";

    
    /**
     * Static metamodel type for {@link com.example.hibernateissue.TestEntity}
     **/
    public static volatile EntityType<TestEntity> class_;
    
    /**
     * Static metamodel for attribute {@link com.example.hibernateissue.TestEntity#tags}
     **/
    public static volatile SingularAttribute<TestEntity, Set> tags;
    
    /**
     * Static metamodel for attribute {@link com.example.hibernateissue.TestEntity#name}
     **/
    public static volatile SingularAttribute<TestEntity, String> name;

}

```

```kotlin
plugins {
    java
    id("org.springframework.boot") version "4.0.6"
    id("io.spring.dependency-management") version "1.1.7"
}

group = "com.example"
version = "0.0.1-SNAPSHOT"
description = "hibernate-issue"

java {
    toolchain {
        languageVersion = JavaLanguageVersion.of(21)
    }
}

repositories {
    mavenCentral()
}

dependencies {
    implementation("org.springframework.boot:spring-boot-starter-data-jpa")
    runtimeOnly("org.postgresql:postgresql")
    annotationProcessor("org.hibernate.orm:hibernate-processor")
    testImplementation("org.springframework.boot:spring-boot-starter-data-jpa-test")
    testRuntimeOnly("org.junit.platform:junit-platform-launcher")
}

tasks.withType<Test> {
    useJUnitPlatform()
}

```

---

<div class="post-metadata">

**Author:** ![beikov](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/beikov/32/258_2.png) [@beikov](https://discourse.hibernate.org/u/beikov)\
**Post date:** [April 30, 2026, 10:05am UTC](https://discourse.hibernate.org/t/metamodel-generator-processor-loses-generic-type-parameter-for-set-string-in-hibernate-7/12227/3 "2026-04-30T10:05:23Z")

</div>

Thanks, this looks like a bug. Please create a bug ticket in our [issue tracker](https://hibernate.atlassian.net) and attach that reproducer.

---

<div class="post-metadata">

**Author:** ![Renato\_Mameli](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/renato_mameli/32/3225_2.png) [@Renato\_Mameli](https://discourse.hibernate.org/u/Renato_Mameli)\
**Post date:** [April 30, 2026, 11:07am UTC](https://discourse.hibernate.org/t/metamodel-generator-processor-loses-generic-type-parameter-for-set-string-in-hibernate-7/12227/4 "2026-04-30T11:07:47Z")

</div>

> **[Jira](https://hibernate.atlassian.net/browse/HHH-20386)**
