File tree Expand file tree Collapse file tree 2 files changed +37
-1
lines changed
main/java/org/springframework/data/aot
test/java/org/springframework/data/aot Expand file tree Collapse file tree 2 files changed +37
-1
lines changed Original file line number Diff line number Diff line change @@ -133,7 +133,9 @@ public Association<AotPersistentProperty> getAssociation() {
133
133
static class AotAccessorFactory extends ClassGeneratingPropertyAccessorFactory {
134
134
135
135
public void initialize (PersistentEntity <?, ?> entity ) {
136
- potentiallyCreateAndRegisterPersistentPropertyAccessorClass (entity );
136
+ if (isSupported (entity )) {
137
+ potentiallyCreateAndRegisterPersistentPropertyAccessorClass (entity );
138
+ }
137
139
}
138
140
}
139
141
Original file line number Diff line number Diff line change @@ -54,6 +54,14 @@ void doesNotCreateEntityForJavaxReference() {
54
54
assertThat (context .getPersistentEntity (javax .naming .Reference .class )).isNull ();
55
55
}
56
56
57
+ @ Test // GH-3361
58
+ void doesNotContributeGeneratedAccessorForUnsupportedType () {
59
+
60
+ assertThatNoException ().isThrownBy (() -> {
61
+ context .contribute (ConcretePerson .class );
62
+ });
63
+ }
64
+
57
65
static class DemoEntity {
58
66
59
67
@ Id String id ;
@@ -78,4 +86,30 @@ static class EntityWithReference {
78
86
javax .naming .Reference reference ;
79
87
}
80
88
89
+ static abstract class AbstractPerson {
90
+
91
+ private String name ;
92
+
93
+ public String getName () {
94
+ return name ;
95
+ }
96
+
97
+ public void setName (String name ) {
98
+ this .name = name ;
99
+ }
100
+ }
101
+
102
+ static class ConcretePerson extends AbstractPerson {
103
+
104
+ private String name ;
105
+
106
+ public String getName () {
107
+ return name ;
108
+ }
109
+
110
+ public void setName (String name ) {
111
+ this .name = name ;
112
+ }
113
+ }
114
+
81
115
}
You can’t perform that action at this time.
0 commit comments