Page 1 of 1
Using Getter on AdornedCollection Hint?
Posted: Mon Dec 09, 2013 12:11 pm
by RapidTransit
Should I be using FieldPersistenceProviderAdapter? My Sku entity requires a Transient field, with a getter that has some logic and it will occasionally be null, it keeps throwing a NullPointerException.
Re: Using Getter on AdornedCollection Hint?
Posted: Mon Dec 09, 2013 12:19 pm
by phillipuniverse
All of the Sku fields should already be going through getters, as a lot of times they can be null (especially in the case of the additional Skus list). See SkuFieldsPersistenceProvider that does what you suggest. You might want to override this to instead always invoke a getter rather than only doing it if the display value is null.
Re: Using Getter on AdornedCollection Hint?
Posted: Tue Dec 10, 2013 9:34 am
by RapidTransit
It looks like line 244 on FormBuilderServiceImpl doesn't like transient fields,
Code: Select all
BasicFieldMetadata md = (BasicFieldMetadata) p.getMetadata();
p.getMetadata comes up empty, worked around it and made a dummy column
Re: Using Getter on AdornedCollection Hint?
Posted: Tue Dec 10, 2013 11:14 am
by phillipuniverse
You could also create BasicFieldMetadata and associate it to the metadata for Skus. I would recommend that over creating a 'dummy' column since that would save you from any database modifications. You can do that from a FieldMetadataProvider implementation. Look at the PasswordFieldMetadataProvider where we add a new 'passwordConfirm' field.