diff --git a/tooling/metamodel-generator/src/jakartaData/java/org/hibernate/processor/test/data/eg/Bookshop.java b/tooling/metamodel-generator/src/jakartaData/java/org/hibernate/processor/test/data/eg/Bookshop.java index 43a266edf0c1..49cd650a66d1 100644 --- a/tooling/metamodel-generator/src/jakartaData/java/org/hibernate/processor/test/data/eg/Bookshop.java +++ b/tooling/metamodel-generator/src/jakartaData/java/org/hibernate/processor/test/data/eg/Bookshop.java @@ -12,6 +12,7 @@ import jakarta.transaction.Transactional; import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; import java.util.List; @@ -19,7 +20,7 @@ public interface Bookshop extends CrudRepository { @Find @Transactional - List byPublisher(String publisher_name); + List byPublisher(@Size(min=2,max=100) String publisher_name); @Find List byTitle(@Nonnull String title); diff --git a/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AbstractQueryMethod.java b/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AbstractQueryMethod.java index 503cdeca0614..b45cd1caf2ea 100644 --- a/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AbstractQueryMethod.java +++ b/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AbstractQueryMethod.java @@ -109,7 +109,7 @@ String strip(final String fullType) { String type = fullType; // strip off type annotations while ( type.charAt(0) == '@' ) { - int startIndex = type.indexOf( ' ' ); + int startIndex = type.lastIndexOf( ' ' ); if ( startIndex > 0 ) { type = type.substring(startIndex+1); }