mysema/querydsl — Issue #104: @QueryEmbedded generates a wrong type in subclass in some cases
Author: teijov
Created: 2012-02-26 17:26:25+00:00
State: open

If fooOfSuperclass is declared like this:

```java
package com.company.framework;
@QueryEntity
public class Superclass {
...
@QueryEmbedded
private List> fooOfSuperclass = new ArrayList>();
...
}
```

the generated Q-class is:

```java
@Generated("com.mysema.query.codegen.EntitySerializer")
public class QSuperclass extends EntityPathBase {
...
public final ListPath, QIdNamePair> fooOfSuperclass = this., QIdNamePair>createList("fooOfSuperclass", IdNamePair.class, QIdNamePair.class);
...
}

```

When the Superclass is inherited:

```java
package com.company.client
@QueryEntity
public class Subclass extends com.company.framework.Superclass {
private int number;
}
```

The generated Q-class for the Subclass is:

```java
@Generated("com.mysema.query.codegen.EntitySerializer")
public class QSubclass extends EntityPathBase {
...
//inherited
public final ListPath, ComparablePath>> fooOfSuperclass = _super.fooOfSuperclass;
public final NumberPath number = createNumber("number", Integer.class);
...
}
```

The problem is that the type parameter of this.fooOfSuperclass is ComparablePath instead of QIdNamePair. This causes the QSubclass not to compile since type parameter of _super.fooOfSuperclass is QIdNamePair.