Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Unexpected path "id" generated in EntityPathBase for JPA class #965
Using com.mysema.maven:apt-maven-plugin:1.1.1 there is a case that an entity without any "id" column (in our case Currency) gets EntityPathBase implementation QCurrency with "id" path in it.
More in the picture. There is getId() overriding abstract method from Currency's superclass BaseObject, but there is no field "id" anywhere (all fields including inherited are shown on the right in a popup).
There should be "name" path (and it is), but no "id" path. Now I can write query:
That throws quite expected:
In JPAAnnotationProcessor, line 46 we make a JPAConfiguration object with the data that is supplied.
we look for the query properties you need by looking at the property access type you request. But if you don't specify an access type, we iterate the members of your entity and look for relevant annotations.
Are you sure your methods of your BaseObject aren't annotated in any way that could make the AnnotationProcessor jump into ALL mode?
Hi! I just debugged the Maven build to get there, went through my Currency entity, got out of this call
Further section behind
The trouble seems to be related to BaseObject indeed - this one has nothing relevent in it, just that abstract getId, but even that one does not determine the access type - and that switches BaseObject to ALL, and generates
Probably this somehow "generates" id path to
It can be resolved by explicitely adding
Produces Q classes:
The same with uncommented