@QueryProjection does not work on @Embeddable classes #909

Closed
yrodiere opened this Issue Aug 25, 2014 · 2 comments

Comments

Projects
None yet
2 participants
@yrodiere

This code won't have the corresponding projection constructor generated :

@Embeddable
public class EmbeddableTest {

    private Integer embeddedProperty;

    public EmbeddableTest() { }

    @QueryProjection
    public EmbeddableTest(Integer embeddedProperty) {
        super();
        this.embeddedProperty = embeddedProperty;
    }

    public Integer getEmbeddedProperty() {
        return embeddedProperty;
    }

    public void setEmbeddedProperty(Integer embeddedProperty) {
        this.embeddedProperty = embeddedProperty;
    }

}

Here is the generated code :

import static com.mysema.query.types.PathMetadataFactory.*;

import com.mysema.query.types.path.*;
import com.mysema.query.types.expr.*;

import com.mysema.query.types.PathMetadata;
import javax.annotation.Generated;
import com.mysema.query.types.Path;
import com.mysema.query.types.ConstructorExpression;
import com.mysema.query.types.Expression;


/**
 * QEmbeddableTest is a Querydsl query type for EmbeddableTest
 */
@Generated("com.mysema.query.codegen.EmbeddableSerializer")
public class QEmbeddableTest extends BeanPath<EmbeddableTest> {

    private static final long serialVersionUID = -886461401L;

    public static final QEmbeddableTest embeddableTest = new QEmbeddableTest("embeddableTest");

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

    public QEmbeddableTest(String variable) {
        super(EmbeddableTest.class, forVariable(variable));
    }

    public QEmbeddableTest(Path<? extends EmbeddableTest> path) {
        super(path.getType(), path.getMetadata());
    }

    public QEmbeddableTest(PathMetadata<?> metadata) {
        super(EmbeddableTest.class, metadata);
    }

}

I thing this may be related to the EmbeddableSerializer, since I haven't encountered this issue on non-@Embeddable classes.

@timowest

This comment has been minimized.

Show comment
Hide comment
@timowest

timowest Aug 26, 2014

Member

Thanks for the bug report. I added now a pull request.

Member

timowest commented Aug 26, 2014

Thanks for the bug report. I added now a pull request.

@timowest timowest added the bug label Aug 26, 2014

@timowest timowest closed this in #911 Aug 27, 2014

@timowest timowest added this to the 3.4.3 milestone Aug 27, 2014

@timowest

This comment has been minimized.

Show comment
Hide comment
@timowest

timowest Aug 31, 2014

Member

Released in 3.4.3

Member

timowest commented Aug 31, 2014

Released in 3.4.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment