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

Already on GitHub? Sign in to your account

Plugin querydsl-maven-plugin:3.3.0 has no logs. #637

Closed
Tibor17 opened this Issue Jan 22, 2014 · 2 comments

Comments

Projects
None yet
2 participants

Tibor17 commented Jan 22, 2014

Talking about plugin's goal "jpa-export" and I am using only javax.persistence.* annotations.

I was facing random behavior of plugin generating Q-classes when the entity classes extended an abstract plain class. It looks like Q-classes are generated randomly, and the super Q-class wasn't generated, however the subclasses delegate to
private final QEntity _super = new QEntity(...);
So I created QEntity.java in private package (without public) because this is a plain class without annotations.
After I wrote "public" modifier on the class and the constructor, everithing worked properly by every build.

For this reason I would appreciate logs in std out to come over these problems.
I would like to control the Entity classes in as well.

Thx.

@Tibor17 Tibor17 closed this Apr 27, 2014

Owner

timowest commented Apr 27, 2014

@Tibor17 Did you find a fix for this issue? I can reopen it and look into, if this is still relevant. Or you can try to provide a pull request.

Tibor17 commented Apr 29, 2014

@timowest
Hi Timo,
My fault was wrong maven plugin configuration which caused such feeling of randomgeneration of classes.
Second part of this issue was reported for version 3.3.0.
This means I have an entity which extends from an ordinal abstract class

@Entity(name = "HASH_CONFIGURATION")
@Table
@Access(AccessType.FIELD)
public class HashConfigEntity extends EntityBase<Long> {
...
}

The abstract super class is without any JPA annotations:

public abstract class EntityBase<PK extends Comparable<PK> & Serializable> implements Serializable {

    public abstract PK getId();
    public abstract boolean hasDefaultId();

    @Override
    public String toString() {
        return String.format("%s{id=%s}", getClass().getSimpleName(), getId());
    }
}

Generated class looks like this:

@Generated("com.mysema.query.codegen.EntitySerializer")
public class QHashConfigEntity extends EntityPathBase<HashConfigEntity> {

    private static final long serialVersionUID = 2093798968L;

    public static final QHashConfigEntity hashConfigEntity = new QHashConfigEntity("hashConfigEntity");

    public final QEntityBase _super = new QEntityBase(this);
...
}

The problem is that QEntityBase must be created by hands.
I am not in hurry to fix it for me now, because my colleagues want to use named queries, however I have different opinion.
So let me decide who will fix it.

In order to use QueryDSL the colleagues want to have some statistics whether Query DSL is heavy in use, and they want to see benefits against named queries (and time spent work, type safety, erroneous code, how much is the work effective in maintenance and development phase).

In my opinion having objective sql like this is easier to use than named queries, easier to maintain all relations, and non-sql guru can use the API because it is intuitive. Even it is cool to pass the where-clause in form of Lambda function to DAO method via parameter.

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