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

Spring Boot 3 RC1 w/ R2DBC generation issue #74

Closed
riba2101 opened this issue Nov 8, 2022 · 7 comments
Closed

Spring Boot 3 RC1 w/ R2DBC generation issue #74

riba2101 opened this issue Nov 8, 2022 · 7 comments

Comments

@riba2101
Copy link

riba2101 commented Nov 8, 2022

When CustomMetaDataSerializer generates the classes, some constructors are missing

    public QAbstractIdEntity(String variable) {
        super((Class) AbstractIdEntity.class, forVariable(variable), null, "AbstractIdEntity");
        addMetadata();
    }

    @SuppressWarnings("all")
    public QAbstractIdEntity(String variable, String schema, String table) {
        super(AbstractIdEntity.class, forVariable(variable), schema, table);
        addMetadata();
    }

    public QAbstractIdEntity(String variable, String schema) {
        super(AbstractIdEntity.class, forVariable(variable), schema, "AbstractIdEntity");
        addMetadata();
    }

Note: the first ctor has the (Class) cast, but the next two dont

The entity classes:

@Getter
@Setter
public abstract class AbstractTemporalEntity
        implements TemporalEntity
{

    @NotNull
    @CreatedDate
    private LocalDateTime createdAt;

    @NotNull
    @LastModifiedDate
    private LocalDateTime updatedAt;

}
@Getter
@Setter
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public abstract class AbstractIdEntity<ID>
        extends AbstractTemporalEntity
        implements IdentityEntity<ID>
{

    @Id
    public ID id;

    protected AbstractIdEntity(ID id) {
        this.id = id;
    }

}
@lpandzic
Copy link
Member

lpandzic commented Nov 9, 2022

Are you using jdbc module? What does the implementation entity look like?

@riba2101
Copy link
Author

riba2101 commented Nov 9, 2022

yes, the spring-data-jdbc is loaded.
this fails even before coming to the impl entity ( this is in the source, the impl entity is in tests)

@lpandzic
Copy link
Member

Ok, but what do you mean by missing constructors? What is the exception?

@riba2101
Copy link
Author

[ERROR] /Users/de164039/work/laganini/laganini-cloud-storage-parent/laganini-cloud-storage-service-r2dbc/target/generated-sources/annotations/org/laganini/cloud/storage/r2dbc/entity/QAbstractIdEntity.java:[37,9] no suitable constructor found for RelationalPathBase(java.lang.Class<org.laganini.cloud.storage.r2dbc.entity.AbstractIdEntity>,com.querydsl.core.types.PathMetadata,java.lang.String,java.lang.String)
[ERROR]     constructor com.querydsl.sql.RelationalPathBase.RelationalPathBase(java.lang.Class<? extends org.laganini.cloud.storage.r2dbc.entity.AbstractIdEntity<?>>,java.lang.String,java.lang.String,java.lang.String) is not applicable
[ERROR]       (argument mismatch; java.lang.Class<org.laganini.cloud.storage.r2dbc.entity.AbstractIdEntity> cannot be converted to java.lang.Class<? extends org.laganini.cloud.storage.r2dbc.entity.AbstractIdEntity<?>>)
[ERROR]     constructor com.querydsl.sql.RelationalPathBase.RelationalPathBase(java.lang.Class<? extends org.laganini.cloud.storage.r2dbc.entity.AbstractIdEntity<?>>,com.querydsl.core.types.PathMetadata,java.lang.String,java.lang.String) is not applicable
[ERROR]       (argument mismatch; java.lang.Class<org.laganini.cloud.storage.r2dbc.entity.AbstractIdEntity> cannot be converted to java.lang.Class<? extends org.laganini.cloud.storage.r2dbc.entity.AbstractIdEntity<?>>)
[ERROR] /Users/de164039/work/laganini/laganini-cloud-storage-parent/laganini-cloud-storage-service-r2dbc/target/generated-sources/annotations/org/laganini/cloud/storage/r2dbc/entity/QAbstractIdEntity.java:[42,9] no suitable constructor found for RelationalPathBase(java.lang.Class<org.laganini.cloud.storage.r2dbc.entity.AbstractIdEntity>,com.querydsl.core.types.PathMetadata,java.lang.String,java.lang.String)
[ERROR]     constructor com.querydsl.sql.RelationalPathBase.RelationalPathBase(java.lang.Class<? extends org.laganini.cloud.storage.r2dbc.entity.AbstractIdEntity<?>>,java.lang.String,java.lang.String,java.lang.String) is not applicable
[ERROR]       (argument mismatch; java.lang.Class<org.laganini.cloud.storage.r2dbc.entity.AbstractIdEntity> cannot be converted to java.lang.Class<? extends org.laganini.cloud.storage.r2dbc.entity.AbstractIdEntity<?>>)
[ERROR]     constructor com.querydsl.sql.RelationalPathBase.RelationalPathBase(java.lang.Class<? extends org.laganini.cloud.storage.r2dbc.entity.AbstractIdEntity<?>>,com.querydsl.core.types.PathMetadata,java.lang.String,java.lang.String) is not applicable
[ERROR]       (argument mismatch; java.lang.Class<org.laganini.cloud.storage.r2dbc.entity.AbstractIdEntity> cannot be converted to java.lang.Class<? extends org.laganini.cloud.storage.r2dbc.entity.AbstractIdEntity<?>>)
[ERROR] /Users/de164039/work/laganini/laganini-cloud-storage-parent/laganini-cloud-storage-service-r2dbc/target/generated-sources/annotations/org/laganini/cloud/storage/r2dbc/entity/QAbstractCompositeIdEntity.java:[37,9] no suitable constructor found for RelationalPathBase(java.lang.Class<org.laganini.cloud.storage.r2dbc.entity.AbstractCompositeIdEntity>,com.querydsl.core.types.PathMetadata,java.lang.String,java.lang.String)
[ERROR]     constructor com.querydsl.sql.RelationalPathBase.RelationalPathBase(java.lang.Class<? extends org.laganini.cloud.storage.r2dbc.entity.AbstractCompositeIdEntity<?>>,java.lang.String,java.lang.String,java.lang.String) is not applicable
[ERROR]       (argument mismatch; java.lang.Class<org.laganini.cloud.storage.r2dbc.entity.AbstractCompositeIdEntity> cannot be converted to java.lang.Class<? extends org.laganini.cloud.storage.r2dbc.entity.AbstractCompositeIdEntity<?>>)
[ERROR]     constructor com.querydsl.sql.RelationalPathBase.RelationalPathBase(java.lang.Class<? extends org.laganini.cloud.storage.r2dbc.entity.AbstractCompositeIdEntity<?>>,com.querydsl.core.types.PathMetadata,java.lang.String,java.lang.String) is not applicable
[ERROR]       (argument mismatch; java.lang.Class<org.laganini.cloud.storage.r2dbc.entity.AbstractCompositeIdEntity> cannot be converted to java.lang.Class<? extends org.laganini.cloud.storage.r2dbc.entity.AbstractCompositeIdEntity<?>>)
[ERROR] /Users/de164039/work/laganini/laganini-cloud-storage-parent/laganini-cloud-storage-service-r2dbc/target/generated-sources/annotations/org/laganini/cloud/storage/r2dbc/entity/QAbstractCompositeIdEntity.java:[42,9] no suitable constructor found for RelationalPathBase(java.lang.Class<org.laganini.cloud.storage.r2dbc.entity.AbstractCompositeIdEntity>,com.querydsl.core.types.PathMetadata,java.lang.String,java.lang.String)
[ERROR]     constructor com.querydsl.sql.RelationalPathBase.RelationalPathBase(java.lang.Class<? extends org.laganini.cloud.storage.r2dbc.entity.AbstractCompositeIdEntity<?>>,java.lang.String,java.lang.String,java.lang.String) is not applicable
[ERROR]       (argument mismatch; java.lang.Class<org.laganini.cloud.storage.r2dbc.entity.AbstractCompositeIdEntity> cannot be converted to java.lang.Class<? extends org.laganini.cloud.storage.r2dbc.entity.AbstractCompositeIdEntity<?>>)
[ERROR]     constructor com.querydsl.sql.RelationalPathBase.RelationalPathBase(java.lang.Class<? extends org.laganini.cloud.storage.r2dbc.entity.AbstractCompositeIdEntity<?>>,com.querydsl.core.types.PathMetadata,java.lang.String,java.lang.String) is not applicable
[ERROR]       (argument mismatch; java.lang.Class<org.laganini.cloud.storage.r2dbc.entity.AbstractCompositeIdEntity> cannot be converted to java.lang.Class<? extends org.laganini.cloud.storage.r2dbc.entity.AbstractCompositeIdEntity<?>>)

As said the generator does not add (Class) cast to the constructors

@lpandzic
Copy link
Member

lpandzic commented Dec 6, 2022

Can you please provide a project that reproduces the issue?

@riba2101
Copy link
Author

riba2101 commented Dec 6, 2022

Sure,

it will just take some time

@lpandzic
Copy link
Member

I'm closing this down as stale. Feel free to reopen if you can provide more info or a reproduction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants