forked from quarkusio/quarkus
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request quarkusio#5308 from ebullient/quarkus-1888
hibernate validator: Remember annotated interface methods
- Loading branch information
Showing
8 changed files
with
145 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
...te-validator/src/main/java/io/quarkus/it/hibernate/validator/EnhancedGreetingService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package io.quarkus.it.hibernate.validator; | ||
|
||
import javax.annotation.Priority; | ||
import javax.enterprise.context.ApplicationScoped; | ||
import javax.enterprise.inject.Alternative; | ||
|
||
@Alternative | ||
@Priority(1) | ||
@ApplicationScoped | ||
public class EnhancedGreetingService extends GreetingService { | ||
|
||
@Override | ||
public String greeting(String name) { | ||
return super.greeting("Enhanced " + name); | ||
} | ||
} |
4 changes: 3 additions & 1 deletion
4
.../hibernate-validator/src/main/java/io/quarkus/it/hibernate/validator/GreetingService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,15 @@ | ||
package io.quarkus.it.hibernate.validator; | ||
|
||
import javax.annotation.Priority; | ||
import javax.enterprise.context.ApplicationScoped; | ||
import javax.validation.constraints.NotNull; | ||
|
||
@ApplicationScoped | ||
@Priority(2) | ||
public class GreetingService { | ||
|
||
public String greeting(@NotNull String name) { | ||
return "hello " + name; | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
...s/hibernate-validator/src/main/java/io/quarkus/it/hibernate/validator/ZipCodeService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package io.quarkus.it.hibernate.validator; | ||
|
||
import javax.validation.constraints.NotNull; | ||
import javax.validation.constraints.Size; | ||
|
||
public interface ZipCodeService { | ||
|
||
public String echoZipCode(@NotNull @Size(min = 5, max = 5) String zipCode); | ||
|
||
} |
12 changes: 12 additions & 0 deletions
12
...bernate-validator/src/main/java/io/quarkus/it/hibernate/validator/ZipCodeServiceImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package io.quarkus.it.hibernate.validator; | ||
|
||
import javax.enterprise.context.ApplicationScoped; | ||
|
||
@ApplicationScoped | ||
public class ZipCodeServiceImpl implements ZipCodeService { | ||
|
||
@Override | ||
public String echoZipCode(String zipCode) { | ||
return zipCode; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters