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() {
133133 static class AotAccessorFactory extends ClassGeneratingPropertyAccessorFactory {
134134
135135 public void initialize (PersistentEntity <?, ?> entity ) {
136- potentiallyCreateAndRegisterPersistentPropertyAccessorClass (entity );
136+ if (isSupported (entity )) {
137+ potentiallyCreateAndRegisterPersistentPropertyAccessorClass (entity );
138+ }
137139 }
138140 }
139141
Original file line number Diff line number Diff line change @@ -54,6 +54,14 @@ void doesNotCreateEntityForJavaxReference() {
5454 assertThat (context .getPersistentEntity (javax .naming .Reference .class )).isNull ();
5555 }
5656
57+ @ Test // GH-3361
58+ void doesNotContributeGeneratedAccessorForUnsupportedType () {
59+
60+ assertThatNoException ().isThrownBy (() -> {
61+ context .contribute (ConcretePerson .class );
62+ });
63+ }
64+
5765 static class DemoEntity {
5866
5967 @ Id String id ;
@@ -78,4 +86,30 @@ static class EntityWithReference {
7886 javax .naming .Reference reference ;
7987 }
8088
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+
81115}
You can’t perform that action at this time.
0 commit comments