package com.mysema.query.domain;

import javax.persistence.Entity;
import javax.persistence.MappedSuperclass;

import org.junit.Test;
import static org.junit.Assert.assertEquals;

public class Generic15Test {

    @MappedSuperclass
    public static abstract class Compound<T extends Containable> {
    }

    @MappedSuperclass
    public static abstract class Containable<T extends Compound> {

        private T compound;
    }

    @Entity
    public static class MyCompound extends Compound<MyContainable>{
    }

    @Entity
    public static class MyContainable extends Containable<MyCompound> {

        private String additionalField;
    }

    @Test
    public void test() {
        // QMyContainable
        assertEquals(MyCompound.class, QGeneric15Test_MyContainable.myContainable.compound.getType());
    }
}

@@ -102,16 +102,64 @@
 erclass;
+%0Aimport java.util.HashSet;%0Aimport java.util.Set;
 %0A%0Aimport
@@ -339,16 +339,73 @@
 nable%3E %7B
+%0A%0A        private Set%3CT%3E containables = new HashSet%3CT%3E();
 %0A    %7D%0A%0A

Update test