@@ -158,7 +158,7 @@ public PropertyModel(ClassModel classModel, Property property, JsonbContext json
158
158
this .setValueHandle = createWriteHandle (field , setter , setterVisible , strategy );
159
159
this .getterMethodType = getterVisible ? property .getGetterType () : null ;
160
160
this .setterMethodType = setterVisible ? property .getSetterType () : null ;
161
- this .customization = introspectCustomization (property , jsonbContext );
161
+ this .customization = introspectCustomization (property , jsonbContext , classModel );
162
162
this .readName = calculateReadWriteName (customization .getJsonReadName (), propertyName ,
163
163
jsonbContext .getConfigProperties ().getPropertyNamingStrategy ());
164
164
this .writeName = calculateReadWriteName (customization .getJsonWriteName (), propertyName ,
@@ -191,11 +191,24 @@ private SerializerBinding<?> getUserSerializerBinding(Property property, JsonbCo
191
191
return jsonbContext .getComponentMatcher ().getSerializerBinding (getPropertySerializationType (), null ).orElse (null );
192
192
}
193
193
194
- private PropertyCustomization introspectCustomization (Property property , JsonbContext jsonbContext ) {
194
+ private PropertyCustomization introspectCustomization (Property property , JsonbContext jsonbContext , ClassModel classModel ) {
195
195
final AnnotationIntrospector introspector = jsonbContext .getAnnotationIntrospector ();
196
196
final PropertyCustomization .Builder builder = PropertyCustomization .builder ();
197
197
//drop all other annotations for transient properties
198
198
EnumSet <AnnotationTarget > transientInfo = introspector .getJsonbTransientCategorized (property );
199
+ ClassModel parent = classModel ;
200
+ // Check parent classes for transient annotations
201
+ while ((parent = parent .getParentClassModel ()) != null ) {
202
+ PropertyModel parentProperty = parent .getPropertyModel (property .getName ());
203
+ if (parentProperty != null ) {
204
+ if (parentProperty .customization .isReadTransient ()) {
205
+ transientInfo .add (AnnotationTarget .GETTER );
206
+ }
207
+ if (parentProperty .customization .isWriteTransient ()) {
208
+ transientInfo .add (AnnotationTarget .SETTER );
209
+ }
210
+ }
211
+ }
199
212
if (transientInfo .size () != 0 ) {
200
213
builder .readTransient (transientInfo .contains (AnnotationTarget .GETTER ));
201
214
builder .writeTransient (transientInfo .contains (AnnotationTarget .SETTER ));
0 commit comments