Skip to content
This repository was archived by the owner on Oct 22, 2020. It is now read-only.

Commit ffb970d

Browse files
committed
Add support for @EbeanComponent (to register other types like BeanPersistController, BeanPersistListener etc)
1 parent 73f33ff commit ffb970d

3 files changed

Lines changed: 9 additions & 0 deletions

File tree

src/main/java/io/ebean/querybean/generator/Constants.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ interface Constants {
1414
String ENTITY = "javax.persistence.Entity";
1515
String EMBEDDABLE = "javax.persistence.Embeddable";
1616
String CONVERTER = "javax.persistence.Converter";
17+
String EBEAN_COMPONENT = "io.ebean.annotation.EbeanComponent";
1718

1819
String DBARRAY = "io.ebean.annotation.DbArray";
1920
String DBJSON = "io.ebean.annotation.DbJson";

src/main/java/io/ebean/querybean/generator/ProcessingContext.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,10 @@ TypeElement converterAnnotation() {
117117
return elementUtils.getTypeElement(CONVERTER);
118118
}
119119

120+
TypeElement componentAnnotation() {
121+
return elementUtils.getTypeElement(EBEAN_COMPONENT);
122+
}
123+
120124
private String generatedAnnotation(boolean jdk8) {
121125
if (jdk8) {
122126
return isTypeAvailable(GENERATED_8) ? GENERATED_8 : null;

src/main/java/io/ebean/querybean/generator/Processor.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ public Set<String> getSupportedAnnotationTypes() {
4343
annotations.add(ENTITY);
4444
annotations.add(EMBEDDABLE);
4545
annotations.add(CONVERTER);
46+
annotations.add(EBEAN_COMPONENT);
4647
annotations.add(MODULEINFO);
4748
return annotations;
4849
}
@@ -86,6 +87,9 @@ private void processOthers(RoundEnvironment roundEnv) {
8687
for (Element element : roundEnv.getElementsAnnotatedWith(processingContext.converterAnnotation())) {
8788
processingContext.addOther(element);
8889
}
90+
for (Element element : roundEnv.getElementsAnnotatedWith(processingContext.componentAnnotation())) {
91+
processingContext.addOther(element);
92+
}
8993
}
9094

9195
private void writeModuleInfoBean() {

0 commit comments

Comments
 (0)