Skip to content

Commit 80c152c

Browse files
committed
Remove obsolete changes findOne optional works in 5.0.x
1 parent 0fcfc18 commit 80c152c

File tree

4 files changed

+1
-12
lines changed

4 files changed

+1
-12
lines changed

data-processor/src/main/java/io/micronaut/data/processor/visitors/finders/FindersUtils.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -381,11 +381,7 @@ private static FindersUtils.InterceptorMatch resolveSyncFindInterceptor(MethodMa
381381
} else if (isContainer(returnType, Iterable.class)) {
382382
return typeAndInterceptorEntry(matchContext, getFirstTypeArgumentOrFail(matchContext, returnType), FindAllInterceptor.class);
383383
} else if (returnType.isArray()) {
384-
ClassElement componentType = returnType.fromArray();
385-
if (componentType.isPrimitive() && componentType.isAssignable(byte.class)) {
386-
return typeAndInterceptorEntry(matchContext, returnType, FindOneInterceptor.class);
387-
}
388-
return typeAndInterceptorEntry(matchContext, componentType, FindAllInterceptor.class);
384+
return typeAndInterceptorEntry(matchContext, returnType.fromArray(), FindAllInterceptor.class);
389385
} else {
390386
return typeAndInterceptorEntry(matchContext, returnType, FindOneInterceptor.class);
391387
}

data-processor/src/main/java/io/micronaut/data/processor/visitors/finders/TypeUtils.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -563,9 +563,6 @@ public static DataType resolveDataType(ClassElement type, Map<String, DataType>
563563
}
564564

565565
if (type.isArray()) {
566-
if (type.isAssignable(byte.class) || type.isAssignable(Byte.class)) {
567-
return DataType.BYTE_ARRAY;
568-
}
569566
if (type.isAssignable(String.class)) {
570567
return DataType.STRING_ARRAY;
571568
}

data-tck/src/main/groovy/io/micronaut/data/tck/tests/AbstractRepositorySpec.groovy

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,6 @@ abstract class AbstractRepositorySpec extends Specification {
587587
expect:
588588
basicTypeRepository.findByteArrayById(entity.myId).present
589589
basicTypeRepository.findByteArrayById(entity.myId).get() == entity.byteArray
590-
basicTypeRepository.getByteArrayById(entity.myId) == entity.byteArray
591590
basicTypeRepository.findByteArrayById(entity.myId).get().class == byte[].class
592591
}
593592

data-tck/src/main/java/io/micronaut/data/tck/repositories/BasicTypesRepository.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@ public interface BasicTypesRepository extends CrudRepository<BasicTypes, Long> {
3434
@Query("select byte_array from basic_types where my_id = :id")
3535
Optional<byte[]> findByteArrayById(Long id);
3636

37-
@Query("select byte_array from basic_types where my_id = :id")
38-
byte[] getByteArrayById(Long id);
39-
4037
BasicTypesProjection queryById(Long id);
4138

4239
Collection<BasicTypesProjection> findAllById(Long id);

0 commit comments

Comments
 (0)