Querydsl is CamelCasing query's field names when JDO object field names are lowercase #1023

Closed
wgtthompson opened this Issue Oct 30, 2014 · 9 comments

Comments

Projects
None yet
3 participants
@wgtthompson
Summary

Querying for an object using JDO. The object's class is in a separate maven project that is included as a dependency. The source for the JDO class has a field storedfile (all lowercase). Log data indicates that the generated query uses storedFile (capitalized "F") instead of storedfile (lowercase "F"). Behavior when where there is a mix of upper- and lower-case are unknown/unexplored.

QueryDSL Components

querydsl-apt 3.3.1
querydsl-jdo 3.3.1
apt-maven-plugin 1.1.1

Log
20141030 042854.150 DEBUG [DataNucleus.Query] JDOQL Query : Compiling "SELECT UNIQUE count(this) FROM mypackage.CapArchiveJdo WHERE this.storedFile.filemd5 == a1 PARAMETERS java.lang.String a1" [main]
20141030 042854.150 DEBUG [DataNucleus.Query] JDOQL Query : Compile Time = 0 ms [main]
20141030 042854.150 DEBUG [DataNucleus.Query] QueryCompilation:
  [result:InvokeExpression{STATIC.count(PrimaryExpression{this})}]
  [filter:DyadicExpression{PrimaryExpression{VariableExpression{this.storedFile}.storedFile.filemd5}  =  ParameterExpression{a1}}]
  [symbols: a1 type=java.lang.String, this.storedFile type=unknown, this type=cmypackage.CapArchiveJdo] [main]
20141030 042854.150 DEBUG [DataNucleus.Query] JDOQL Query : Compiling "SELECT UNIQUE count(this) FROM mypackage.CapArchiveJdo WHERE this.storedFile.filemd5 == a1 PARAMETERS java.lang.String a1" for datastore [main]
20141030 042854.150 DEBUG [DataNucleus.Query] QueryToSQL.processVariable (unbound) variable=this.storedFile is not yet bound so returning UnboundExpression [main]
20141030 042854.166 INFO  [DataNucleus.JDO] Exception thrown [main]
Variable 'this.storedFile' is unbound and cannot be determined (is it a misspelled field name? or is not intended to be a variable?)
Error Stack-Trace
org.datanucleus.exceptions.NucleusUserException: Variable 'this.storedFile' is unbound and cannot be determined (is it a misspelled field name? or is not intended to be a variable?)
    at org.datanucleus.store.rdbms.query.QueryToSQLMapper.processUnboundExpression(QueryToSQLMapper.java:3436)
    at org.datanucleus.store.rdbms.query.QueryToSQLMapper.processPrimaryExpression(QueryToSQLMapper.java:2157)
    at org.datanucleus.query.evaluator.AbstractExpressionEvaluator.compilePrimaryExpression(AbstractExpressionEvaluator.java:181)
    at org.datanucleus.query.evaluator.AbstractExpressionEvaluator.compileUnaryExpression(AbstractExpressionEvaluator.java:170)
    at org.datanucleus.query.evaluator.AbstractExpressionEvaluator.compileAdditiveMultiplicativeExpression(AbstractExpressionEvaluator.java:149)
    at org.datanucleus.query.evaluator.AbstractExpressionEvaluator.compileRelationalExpression(AbstractExpressionEvaluator.java:124)
    at org.datanucleus.query.evaluator.AbstractExpressionEvaluator.compileOrAndExpression(AbstractExpressionEvaluator.java:66)
    at org.datanucleus.query.evaluator.AbstractExpressionEvaluator.evaluate(AbstractExpressionEvaluator.java:46)
    at org.datanucleus.query.expression.Expression.evaluate(Expression.java:332)
    at org.datanucleus.query.expression.DyadicExpression.evaluate(DyadicExpression.java:67)
    at org.datanucleus.store.rdbms.query.QueryToSQLMapper.compileFilter(QueryToSQLMapper.java:464)
    at org.datanucleus.store.rdbms.query.QueryToSQLMapper.compile(QueryToSQLMapper.java:384)
    at org.datanucleus.store.rdbms.query.JDOQLQuery.compileQueryFull(JDOQLQuery.java:937)
    at org.datanucleus.store.rdbms.query.JDOQLQuery.compileInternal(JDOQLQuery.java:343)
    at org.datanucleus.store.query.Query.executeQuery(Query.java:1801)
    at org.datanucleus.store.query.Query.executeWithArray(Query.java:1729)
    at org.datanucleus.api.jdo.JDOQuery.executeWithArray(JDOQuery.java:314)
    at com.mysema.query.jdo.AbstractJDOQuery.execute(AbstractJDOQuery.java:205)
    at com.mysema.query.jdo.AbstractJDOQuery.count(AbstractJDOQuery.java:127)
[junit stack redacted]
Keywords

querydsl capital case JDO JPA query unbounded datanucleus jpox

@wgtthompson wgtthompson changed the title from Querydsl is CamelCasing JDO query parameter names when field names are all lowercase to Querydsl is CamelCasing JDO query parameter names when JDO Object field names are all lowercase Oct 30, 2014

@timowest

This comment has been minimized.

Show comment
Hide comment
@timowest

timowest Oct 30, 2014

Member

Thanks for the bug report. Could you provide the sources for CapArchiveJdo?

Member

timowest commented Oct 30, 2014

Thanks for the bug report. Could you provide the sources for CapArchiveJdo?

@wgtthompson

This comment has been minimized.

Show comment
Hide comment
@wgtthompson

wgtthompson Oct 30, 2014

@timowest Below is the source for the class you requested. I also included the auto-generated source from Querydsl and the source of the StoredFileJdo class.

Query

Query that threw the exception in OP

QCapArchiveJdo o = QCapArchiveJdo.capArchiveJdo;
JDOQuery q = new JDOQuery(pm);
long count = q.from(o).where(o.storedFile.filemd5.eq(md5hex)).count();
CapArchiveJdo.java

Here is the source for the class being queried.

@PersistenceCapable //annot for querydsl
public final class CapArchiveJdo {

    private CapArchiveType catype;
    private String filename;
    private StoredFileJdo storedfile;
    private Collection<CapArchiveIndexEntryJdo> index = new HashSet<CapArchiveIndexEntryJdo>(); 

    public CapArchiveJdo(CapArchiveType catype, String filename, long filesize, String md5hex) {
        this.storedfile = new StoredFileJdo(filesize,md5hex);
        this.setFileName(filename);
        this.setCaptureArchiveType(catype);
    }

    public StoredFileJdo getStoredFile(){
        return this.storedfile;
    }

    public CapArchiveType getCaptureArchiveType() {
        return this.catype;
    }

    void setCaptureArchiveType(CapArchiveType catype) {
        this.catype = catype;
    }

    public void setFileName(String filename) {
        this.filename = filename.toString();
    }

    public String getFileName() {
        return this.filename;
    }

    @Override
    public String toString(){
        return JdoUtils.jdoObjectToString(this);
    }

    public Collection<CapArchiveIndexEntryJdo> getCaptureIndex() {
        return this.index;
    }
}
QCapArchiveJdo.java

Source of auto-generated class in maven target/generated-sources/java/...

/**
 * QCapArchiveJdo is a Querydsl query type for CapArchiveJdo
 */
@Generated("com.mysema.query.codegen.EntitySerializer")
public class QCapArchiveJdo extends EntityPathBase<CapArchiveJdo> {

    private static final long serialVersionUID = -880406374L;

    private static final PathInits INITS = PathInits.DIRECT2;

    public static final QCapArchiveJdo capArchiveJdo = new QCapArchiveJdo("capArchiveJdo");

    public final EnumPath<CapArchiveType> captureArchiveType = createEnum("captureArchiveType", CapArchiveType.class);

    public final CollectionPath<CapArchiveIndexEntryJdo, QCapArchiveIndexEntryJdo> captureIndex = this.<CapArchiveIndexEntryJdo, QCapArchiveIndexEntryJdo>createCollection("captureIndex", CapArchiveIndexEntryJdo.class, QCapArchiveIndexEntryJdo.class, PathInits.DIRECT2);

    public final EnumPath<CapArchiveType> catype = createEnum("catype", CapArchiveType.class);

    public final StringPath fileName = createString("fileName");

    public final CollectionPath<CapArchiveIndexEntryJdo, QCapArchiveIndexEntryJdo> index = this.<CapArchiveIndexEntryJdo, QCapArchiveIndexEntryJdo>createCollection("index", CapArchiveIndexEntryJdo.class, QCapArchiveIndexEntryJdo.class, PathInits.DIRECT2);

    public final mypackage.QStoredFileJdo storedFile;

    public QCapArchiveJdo(String variable) {
        this(CapArchiveJdo.class, forVariable(variable), INITS);
    }

    public QCapArchiveJdo(Path<CapArchiveJdo> path) {
        this(path.getType(), path.getMetadata(), path.getMetadata().isRoot() ? INITS : PathInits.DEFAULT);
    }

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

    public QCapArchiveJdo(PathMetadata<?> metadata, PathInits inits) {
        this(CapArchiveJdo.class, metadata, inits);
    }

    public QCapArchiveJdo(Class<? extends CapArchiveJdo> type, PathMetadata<?> metadata, PathInits inits) {
        super(type, metadata, inits);
        this.storedFile = inits.isInitialized("storedFile") ? new mypackage.QStoredFileJdo(forProperty("storedFile")) : null;
    }

}
StoredFileJdo.java

The source for the object/class being referenced query through the main class

@PersistenceCapable
public final class StoredFileJdo {

    private Long length;
    private Collection<StoredLocationJdo> locations = new HashSet<StoredLocationJdo>();
    private String filemd5;

    public String getFilemd5() {
        return filemd5;
    }

    public void setFilemd5(String filemd5) {
        this.filemd5 = filemd5;
    }

    public StoredFileJdo(long nbytes, String filemd5) {
        this.length = nbytes;
        this.filemd5 = filemd5;
    }

    public boolean addLocation(StoredLocationJdo loc) {
        if (!this.getFilemd5().equals(loc.getFilemd5())) {
            throw new IllegalArgumentException("Location file md5 does not match this md5. locmd5=" + loc.getFilemd5() + " thismd5=" + this.getFilemd5());
        }
        return this.locations.add(loc);
    }

    public boolean removeLocation(StoredLocationJdo loc) {
        return this.locations.remove(loc);
    }

    public Collection<StoredLocationJdo> viewLocations(){
        return Collections.unmodifiableCollection(this.locations);
    }

    public long getLength() {
        return length;
    }

    public InputStream openInputStream() throws IOException {
        Collection<StoredLocationJdo> locs = this.locations;
        locs = StoredLocationJdo.filterForInputStreamAvailable(locs);
        locs = StoredLocationJdo.prioritizeForInputStream(locs);
        if (locs.isEmpty()) {
            throw new FileNotFoundException("There are currently no available locations for this file");
        }
        List<IOException> exceptions = null;
        for (StoredLocationJdo l : locs) {
            try {
                return l.openInputStream();
            } catch (IOException e) {
                if (exceptions == null) {
                    exceptions = new LinkedList<IOException>();
                }
                exceptions.add(e);
            }
        }

        throw new IOException("All available locations failed to provide the file");

    }

    @Override
    public String toString(){
        return super.toString() + "[filemd5=" + this.getFilemd5() + "]";
    }
}
Notes

Maybe the camel-casing is being picked up from the get-method name? You can see that CapArchiveJdo.storedfile and StoreFileJdo.filemd5 are both lower case but storedfile has a capitalized get method while filemd5 does not.

I confirmed that both maven projects are using the same versions of Querydsl (3.3.1/3.3.1/1.1.1).

I have compiler annotation processing turned off in both maven projects because I was getting duplicate class name exceptions during build. I don't know if that is relevant.

         <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.1</version>
            <configuration>
               <source>1.7</source>
               <target>1.7</target>
               <!-- disable annotation processing for querydsl -->
               <compilerArgument>-proc:none</compilerArgument>
            </configuration>
         </plugin>

@timowest Below is the source for the class you requested. I also included the auto-generated source from Querydsl and the source of the StoredFileJdo class.

Query

Query that threw the exception in OP

QCapArchiveJdo o = QCapArchiveJdo.capArchiveJdo;
JDOQuery q = new JDOQuery(pm);
long count = q.from(o).where(o.storedFile.filemd5.eq(md5hex)).count();
CapArchiveJdo.java

Here is the source for the class being queried.

@PersistenceCapable //annot for querydsl
public final class CapArchiveJdo {

    private CapArchiveType catype;
    private String filename;
    private StoredFileJdo storedfile;
    private Collection<CapArchiveIndexEntryJdo> index = new HashSet<CapArchiveIndexEntryJdo>(); 

    public CapArchiveJdo(CapArchiveType catype, String filename, long filesize, String md5hex) {
        this.storedfile = new StoredFileJdo(filesize,md5hex);
        this.setFileName(filename);
        this.setCaptureArchiveType(catype);
    }

    public StoredFileJdo getStoredFile(){
        return this.storedfile;
    }

    public CapArchiveType getCaptureArchiveType() {
        return this.catype;
    }

    void setCaptureArchiveType(CapArchiveType catype) {
        this.catype = catype;
    }

    public void setFileName(String filename) {
        this.filename = filename.toString();
    }

    public String getFileName() {
        return this.filename;
    }

    @Override
    public String toString(){
        return JdoUtils.jdoObjectToString(this);
    }

    public Collection<CapArchiveIndexEntryJdo> getCaptureIndex() {
        return this.index;
    }
}
QCapArchiveJdo.java

Source of auto-generated class in maven target/generated-sources/java/...

/**
 * QCapArchiveJdo is a Querydsl query type for CapArchiveJdo
 */
@Generated("com.mysema.query.codegen.EntitySerializer")
public class QCapArchiveJdo extends EntityPathBase<CapArchiveJdo> {

    private static final long serialVersionUID = -880406374L;

    private static final PathInits INITS = PathInits.DIRECT2;

    public static final QCapArchiveJdo capArchiveJdo = new QCapArchiveJdo("capArchiveJdo");

    public final EnumPath<CapArchiveType> captureArchiveType = createEnum("captureArchiveType", CapArchiveType.class);

    public final CollectionPath<CapArchiveIndexEntryJdo, QCapArchiveIndexEntryJdo> captureIndex = this.<CapArchiveIndexEntryJdo, QCapArchiveIndexEntryJdo>createCollection("captureIndex", CapArchiveIndexEntryJdo.class, QCapArchiveIndexEntryJdo.class, PathInits.DIRECT2);

    public final EnumPath<CapArchiveType> catype = createEnum("catype", CapArchiveType.class);

    public final StringPath fileName = createString("fileName");

    public final CollectionPath<CapArchiveIndexEntryJdo, QCapArchiveIndexEntryJdo> index = this.<CapArchiveIndexEntryJdo, QCapArchiveIndexEntryJdo>createCollection("index", CapArchiveIndexEntryJdo.class, QCapArchiveIndexEntryJdo.class, PathInits.DIRECT2);

    public final mypackage.QStoredFileJdo storedFile;

    public QCapArchiveJdo(String variable) {
        this(CapArchiveJdo.class, forVariable(variable), INITS);
    }

    public QCapArchiveJdo(Path<CapArchiveJdo> path) {
        this(path.getType(), path.getMetadata(), path.getMetadata().isRoot() ? INITS : PathInits.DEFAULT);
    }

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

    public QCapArchiveJdo(PathMetadata<?> metadata, PathInits inits) {
        this(CapArchiveJdo.class, metadata, inits);
    }

    public QCapArchiveJdo(Class<? extends CapArchiveJdo> type, PathMetadata<?> metadata, PathInits inits) {
        super(type, metadata, inits);
        this.storedFile = inits.isInitialized("storedFile") ? new mypackage.QStoredFileJdo(forProperty("storedFile")) : null;
    }

}
StoredFileJdo.java

The source for the object/class being referenced query through the main class

@PersistenceCapable
public final class StoredFileJdo {

    private Long length;
    private Collection<StoredLocationJdo> locations = new HashSet<StoredLocationJdo>();
    private String filemd5;

    public String getFilemd5() {
        return filemd5;
    }

    public void setFilemd5(String filemd5) {
        this.filemd5 = filemd5;
    }

    public StoredFileJdo(long nbytes, String filemd5) {
        this.length = nbytes;
        this.filemd5 = filemd5;
    }

    public boolean addLocation(StoredLocationJdo loc) {
        if (!this.getFilemd5().equals(loc.getFilemd5())) {
            throw new IllegalArgumentException("Location file md5 does not match this md5. locmd5=" + loc.getFilemd5() + " thismd5=" + this.getFilemd5());
        }
        return this.locations.add(loc);
    }

    public boolean removeLocation(StoredLocationJdo loc) {
        return this.locations.remove(loc);
    }

    public Collection<StoredLocationJdo> viewLocations(){
        return Collections.unmodifiableCollection(this.locations);
    }

    public long getLength() {
        return length;
    }

    public InputStream openInputStream() throws IOException {
        Collection<StoredLocationJdo> locs = this.locations;
        locs = StoredLocationJdo.filterForInputStreamAvailable(locs);
        locs = StoredLocationJdo.prioritizeForInputStream(locs);
        if (locs.isEmpty()) {
            throw new FileNotFoundException("There are currently no available locations for this file");
        }
        List<IOException> exceptions = null;
        for (StoredLocationJdo l : locs) {
            try {
                return l.openInputStream();
            } catch (IOException e) {
                if (exceptions == null) {
                    exceptions = new LinkedList<IOException>();
                }
                exceptions.add(e);
            }
        }

        throw new IOException("All available locations failed to provide the file");

    }

    @Override
    public String toString(){
        return super.toString() + "[filemd5=" + this.getFilemd5() + "]";
    }
}
Notes

Maybe the camel-casing is being picked up from the get-method name? You can see that CapArchiveJdo.storedfile and StoreFileJdo.filemd5 are both lower case but storedfile has a capitalized get method while filemd5 does not.

I confirmed that both maven projects are using the same versions of Querydsl (3.3.1/3.3.1/1.1.1).

I have compiler annotation processing turned off in both maven projects because I was getting duplicate class name exceptions during build. I don't know if that is relevant.

         <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.1</version>
            <configuration>
               <source>1.7</source>
               <target>1.7</target>
               <!-- disable annotation processing for querydsl -->
               <compilerArgument>-proc:none</compilerArgument>
            </configuration>
         </plugin>

@wgtthompson wgtthompson changed the title from Querydsl is CamelCasing JDO query parameter names when JDO Object field names are all lowercase to Querydsl is CamelCasing query's field names when JDO Object field names are all lowercase Oct 30, 2014

@wgtthompson wgtthompson changed the title from Querydsl is CamelCasing query's field names when JDO Object field names are all lowercase to Querydsl is CamelCasing query's field names when JDO Object field names lowercase Oct 30, 2014

@wgtthompson wgtthompson changed the title from Querydsl is CamelCasing query's field names when JDO Object field names lowercase to Querydsl is CamelCasing query's field names when JDO Object field names are lowercase Oct 30, 2014

@wgtthompson wgtthompson changed the title from Querydsl is CamelCasing query's field names when JDO Object field names are lowercase to Querydsl is CamelCasing query's field names when JDO object field names are lowercase Oct 30, 2014

@wgtthompson

This comment has been minimized.

Show comment
Hide comment
@wgtthompson

wgtthompson Oct 30, 2014

Confirmed. Changed getter method from getStoredFile() to getStoredfile() (lowercase "F") in CapArchiveJdo but left field storedfile unchanged. I rebuilt the project and QCapArchiveJdo.storedFile changed to QCapArchiveJdo.storedfile (lowercase). I fixed the code where that field was used and re-ran the query. The query worked. Below is the log output.

20141030 174752.131 DEBUG [com.mysema.query.jdo.JDOQuery] SELECT count(this)  FROM mypackage.CapArchiveJdo WHERE this.storedfile.filemd5 == a1 PARAMETERS java.lang.String a1 [main]
20141030 174752.131 DEBUG [DataNucleus.Query] JDOQL Single-String with "SELECT count(this)

FROM mypackage.CapArchiveJdo
WHERE this.storedfile.filemd5 == a1
PARAMETERS java.lang.String a1" [main]
20141030 174752.131 DEBUG [DataNucleus.Query] JDOQL Query : Compiling "SELECT UNIQUE count(this) FROM mypackage.CapArchiveJdo WHERE this.storedfile.filemd5 == a1 PARAMETERS java.lang.String a1" [main]
20141030 174752.131 DEBUG [DataNucleus.Query] JDOQL Query : Compile Time = 0 ms [main]
20141030 174752.131 DEBUG [DataNucleus.Query] QueryCompilation:
  [result:InvokeExpression{STATIC.count(PrimaryExpression{this})}]
  [filter:DyadicExpression{PrimaryExpression{this.storedfile.filemd5}  =  ParameterExpression{a1}}]
  [symbols: a1 type=java.lang.String, this type=mypackage.CapArchiveJdo] [main]
20141030 174752.131 DEBUG [DataNucleus.Query] JDOQL Query : Compiling "SELECT UNIQUE count(this) FROM mypackage.CapArchiveJdo WHERE this.storedfile.filemd5 == a1 PARAMETERS java.lang.String a1" for datastore [main]
20141030 174752.147 DEBUG [DataNucleus.Query] Updating mapping of org.datanucleus.store.rdbms.sql.expression.StringLiteral@7105f21c to be org.datanucleus.store.rdbms.mapping.java.StringMapping@7d4942dc [main]
20141030 174752.147 DEBUG [DataNucleus.Query] JDOQL Query : Compile Time for datastore = 16 ms [main]
20141030 174752.147 DEBUG [DataNucleus.Query] SELECT UNIQUE count(this) FROM mypackage.CapArchiveJdo WHERE this.storedfile.filemd5 == a1 PARAMETERS java.lang.String a1 Query compiled to datastore query "SELECT COUNT(DISTINCT (a0.caparchive_id)) FROM caparchive a0 INNER JOIN storedfile b0 ON a0.fstorefile_id = b0.storedfile_id WHERE b0.filemd5 = ?" [main]
20141030 174752.147 DEBUG [DataNucleus.Query] JDOQL Query : Executing "SELECT UNIQUE count(this) FROM mypackage.CapArchiveJdo WHERE this.storedfile.filemd5 == a1 PARAMETERS java.lang.String a1" ... [main]
20141030 174752.569 DEBUG [DataNucleus.Query] JDOQL Query : Execution Time = 422 ms [main]

Confirmed. Changed getter method from getStoredFile() to getStoredfile() (lowercase "F") in CapArchiveJdo but left field storedfile unchanged. I rebuilt the project and QCapArchiveJdo.storedFile changed to QCapArchiveJdo.storedfile (lowercase). I fixed the code where that field was used and re-ran the query. The query worked. Below is the log output.

20141030 174752.131 DEBUG [com.mysema.query.jdo.JDOQuery] SELECT count(this)  FROM mypackage.CapArchiveJdo WHERE this.storedfile.filemd5 == a1 PARAMETERS java.lang.String a1 [main]
20141030 174752.131 DEBUG [DataNucleus.Query] JDOQL Single-String with "SELECT count(this)

FROM mypackage.CapArchiveJdo
WHERE this.storedfile.filemd5 == a1
PARAMETERS java.lang.String a1" [main]
20141030 174752.131 DEBUG [DataNucleus.Query] JDOQL Query : Compiling "SELECT UNIQUE count(this) FROM mypackage.CapArchiveJdo WHERE this.storedfile.filemd5 == a1 PARAMETERS java.lang.String a1" [main]
20141030 174752.131 DEBUG [DataNucleus.Query] JDOQL Query : Compile Time = 0 ms [main]
20141030 174752.131 DEBUG [DataNucleus.Query] QueryCompilation:
  [result:InvokeExpression{STATIC.count(PrimaryExpression{this})}]
  [filter:DyadicExpression{PrimaryExpression{this.storedfile.filemd5}  =  ParameterExpression{a1}}]
  [symbols: a1 type=java.lang.String, this type=mypackage.CapArchiveJdo] [main]
20141030 174752.131 DEBUG [DataNucleus.Query] JDOQL Query : Compiling "SELECT UNIQUE count(this) FROM mypackage.CapArchiveJdo WHERE this.storedfile.filemd5 == a1 PARAMETERS java.lang.String a1" for datastore [main]
20141030 174752.147 DEBUG [DataNucleus.Query] Updating mapping of org.datanucleus.store.rdbms.sql.expression.StringLiteral@7105f21c to be org.datanucleus.store.rdbms.mapping.java.StringMapping@7d4942dc [main]
20141030 174752.147 DEBUG [DataNucleus.Query] JDOQL Query : Compile Time for datastore = 16 ms [main]
20141030 174752.147 DEBUG [DataNucleus.Query] SELECT UNIQUE count(this) FROM mypackage.CapArchiveJdo WHERE this.storedfile.filemd5 == a1 PARAMETERS java.lang.String a1 Query compiled to datastore query "SELECT COUNT(DISTINCT (a0.caparchive_id)) FROM caparchive a0 INNER JOIN storedfile b0 ON a0.fstorefile_id = b0.storedfile_id WHERE b0.filemd5 = ?" [main]
20141030 174752.147 DEBUG [DataNucleus.Query] JDOQL Query : Executing "SELECT UNIQUE count(this) FROM mypackage.CapArchiveJdo WHERE this.storedfile.filemd5 == a1 PARAMETERS java.lang.String a1" ... [main]
20141030 174752.569 DEBUG [DataNucleus.Query] JDOQL Query : Execution Time = 422 ms [main]
@Shredder121

This comment has been minimized.

Show comment
Hide comment
@Shredder121

Shredder121 Oct 30, 2014

Member

It is always recommended to have consistent naming policies/strategies.
Some frameworks even require them to be equal, while some frameworks' behaviour is undefined.

If Querydsl were to check for consistency, that would slow down every build.

Member

Shredder121 commented Oct 30, 2014

It is always recommended to have consistent naming policies/strategies.
Some frameworks even require them to be equal, while some frameworks' behaviour is undefined.

If Querydsl were to check for consistency, that would slow down every build.

@wgtthompson

This comment has been minimized.

Show comment
Hide comment
@wgtthompson

wgtthompson Oct 30, 2014

@Shredder121 The flip-side of the argument is that frameworks should work within the bounds of the contracts/APIs they interface with or abstract. JDO query syntax uses the field name; not the method name.

@Shredder121 The flip-side of the argument is that frameworks should work within the bounds of the contracts/APIs they interface with or abstract. JDO query syntax uses the field name; not the method name.

@Shredder121

This comment has been minimized.

Show comment
Hide comment
@Shredder121

Shredder121 Oct 31, 2014

Member

There you have a point, and I didn't know that.
Could you maybe post a source for that statement?
That way we have all our findings for this issue in one place.

Member

Shredder121 commented Oct 31, 2014

There you have a point, and I didn't know that.
Could you maybe post a source for that statement?
That way we have all our findings for this issue in one place.

@wgtthompson

This comment has been minimized.

Show comment
Hide comment
@wgtthompson

wgtthompson Oct 31, 2014

JDO Specification 3.1, Release Candidate 1, JDOQL BNF (page 401)
https://db.apache.org/jdo/specifications.html

Example

Partial BNF for function count(...)

count ( distinct_opt CountArgument )
CountArgument:
     this
     FieldAccess
     VariableName
FieldAccess:
     FieldName
     Primary . FieldName

JDO Specification 3.1, Release Candidate 1, JDOQL BNF (page 401)
https://db.apache.org/jdo/specifications.html

Example

Partial BNF for function count(...)

count ( distinct_opt CountArgument )
CountArgument:
     this
     FieldAccess
     VariableName
FieldAccess:
     FieldName
     Primary . FieldName
@timowest

This comment has been minimized.

Show comment
Hide comment
@timowest

timowest Oct 31, 2014

Member

Based on this document annotated getters should be handled as well http://www.datanucleus.org/products/datanucleus/jdo/fields_properties.html

Member

timowest commented Oct 31, 2014

Based on this document annotated getters should be handled as well http://www.datanucleus.org/products/datanucleus/jdo/fields_properties.html

@timowest timowest added this to the 3.6.0 milestone Nov 1, 2014

@timowest timowest closed this in #1024 Nov 3, 2014

@timowest

This comment has been minimized.

Show comment
Hide comment
@timowest

timowest Nov 30, 2014

Member

Released in 3.6.0

Member

timowest commented Nov 30, 2014

Released in 3.6.0

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