@@ -241,12 +241,6 @@ class JdbcQueryCreator extends RelationalQueryCreator<ParametrizedQuery> {
|
||||
|
||||
PersistentPropertyPathExtension extPath = new PersistentPropertyPathExtension(context, path);
|
||||
|
||||
// add a join if necessary
|
||||
Join join = getJoin(sqlContext, extPath);
|
||||
if (join != null) {
|
||||
joinTables.add(join);
|
||||
}
|
||||
|
||||
if (returnedType.needsCustomConstruction()) {
|
||||
if (!returnedType.getInputProperties()
|
||||
.contains(extPath.getRequiredPersistentPropertyPath().getBaseProperty().getName())) {
|
||||
@@ -254,6 +248,12 @@ class JdbcQueryCreator extends RelationalQueryCreator<ParametrizedQuery> {
|
||||
}
|
||||
}
|
||||
|
||||
// add a join if necessary
|
||||
Join join = getJoin(sqlContext, extPath);
|
||||
if (join != null) {
|
||||
joinTables.add(join);
|
||||
}
|
||||
|
||||
Column column = getColumn(sqlContext, extPath);
|
||||
if (column != null) {
|
||||
columnExpressions.add(column);
|
||||
|
||||
@@ -126,7 +126,7 @@ public class PartTreeJdbcQueryUnitTests {
|
||||
PartTreeJdbcQuery jdbcQuery = createQuery(queryMethod);
|
||||
ParametrizedQuery query = jdbcQuery.createQuery(getAccessor(queryMethod, new Object[] { "John" }), returnedType);
|
||||
|
||||
assertThat(query.getQuery()).isEqualTo("SELECT " + TABLE + ".\"FIRST_NAME\" AS \"FIRST_NAME\" " + JOIN_CLAUSE
|
||||
assertThat(query.getQuery()).isEqualTo("SELECT " + TABLE + ".\"FIRST_NAME\" AS \"FIRST_NAME\" FROM \"users\""
|
||||
+ " WHERE " + TABLE + ".\"FIRST_NAME\" = :first_name");
|
||||
}
|
||||
|
||||
@@ -601,6 +601,8 @@ public class PartTreeJdbcQueryUnitTests {
|
||||
|
||||
List<User> findAllByHated(Hobby hobby);
|
||||
|
||||
List<User> findAllByHatedName(String name);
|
||||
|
||||
List<User> findAllByHobbies(Object hobbies);
|
||||
|
||||
List<User> findAllByHobbyReference(Hobby hobby);
|
||||
|
||||
Reference in New Issue
Block a user