Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HibernateDomainExporter and inheritance with composite-id #1459

vveloso opened this issue Jul 28, 2015 · 0 comments

HibernateDomainExporter and inheritance with composite-id #1459

vveloso opened this issue Jul 28, 2015 · 0 comments


Copy link

@vveloso vveloso commented Jul 28, 2015

With QueryDSL 3.6.5, the following XML mappings generate public final fields that are not initialized in leaf types.

<hibernate-mapping default-access="field" default-lazy="false">
 <class abstract="true"
  name="ConnectionRouteDb" table="DCN_NE_ROUTES">
  <composite-id access="field" name="routeKey" class="ConnectionRouteDbKey">
   <key-property name="type" type="string" column="ROUTE_TYPE"/>
   <key-property name="key" type="string" column="ROUTE_KEY"/>
  <discriminator force="false" insert="false" not-null="true">
   <column name="ROUTE_TYPE"/>
  <version access="field" column="VERSION" generated="never"
   name="version" type="int"/>
  <property access="field" generated="never" lazy="false" name="cost" type="int">
   <column name="COST"/>
  <property access="field" generated="never" lazy="false" name="neId" type="int">
   <column name="NE_ID"/>
 <subclass discriminator-value="GATEWAY"
  extends="ConnectionRouteDb" lazy="false"
  name="GatewayRouteDb" select-before-update="false">


public class QNeConnectionRouteDb extends EntityPathBase<NeConnectionRouteDb<?, ?>> {

    private static final long serialVersionUID = -2050193206L;

    private static final PathInits INITS = PathInits.DIRECT2;

    public static final QNeConnectionRouteDb neConnectionRouteDb = new QNeConnectionRouteDb("neConnectionRouteDb");

    public final _super = new;

    public final NumberPath<Integer> cost = createNumber("cost", Integer.class);

    public final NumberPath<Integer> neId = createNumber("neId", Integer.class);

    public final QNeConnectionRouteDbKey routeKey;

    public final NumberPath<Integer> version = createNumber("version", Integer.class);

    public QNeConnectionRouteDb(String variable) {
        this((Class)NeConnectionRouteDb.class, forVariable(variable), INITS);

    public QNeConnectionRouteDb(Path<? extends NeConnectionRouteDb> path) {
        this((Class)path.getType(), path.getMetadata(), path.getMetadata().isRoot() ? INITS : PathInits.DEFAULT);

    public QNeConnectionRouteDb(PathMetadata<?> metadata) {
        this(metadata, metadata.isRoot() ? INITS : PathInits.DEFAULT);

    public QNeConnectionRouteDb(PathMetadata<?> metadata, PathInits inits) {
        this((Class)NeConnectionRouteDb.class, metadata, inits);

    public QNeConnectionRouteDb(Class<? extends NeConnectionRouteDb<?, ?>> type, PathMetadata<?> metadata, PathInits inits) {
        super(type, metadata, inits);
        this.routeKey = inits.isInitialized("routeKey") ? new QNeConnectionRouteDbKey(forProperty("routeKey")) : null;

public class QNeGatewayRouteDb extends EntityPathBase<NeGatewayRouteDb> {

    private static final long serialVersionUID = 169698434L;

    public static final QNeGatewayRouteDb neGatewayRouteDb = new QNeGatewayRouteDb("neGatewayRouteDb");

    public final QNeConnectionRouteDb _super;

    public final NumberPath<Integer> cost;

    public final NumberPath<Integer> neId;

    // custom
    public final QNeConnectionRouteDbKey routeKey = new QNeConnectionRouteDbKey(forProperty("routeKey"));

    public final NumberPath<Integer> version;

    public QNeGatewayRouteDb(String variable) {
        super(NeGatewayRouteDb.class, forVariable(variable));

    public QNeGatewayRouteDb(Path<? extends NeGatewayRouteDb> path) {
        super(path.getType(), path.getMetadata());

    public QNeGatewayRouteDb(PathMetadata<?> metadata) {
        super(NeGatewayRouteDb.class, metadata);


Which does not compile.

The same issue happens on 3.6.3. I did not test 3.6.4.

If the key is simple instead of composite, the code is generated correctly. Unfortunately I need to use composite keys.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants