You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We need the ability to determine the schema of Immutable objects that are persisted in a database like MongoDB. Since there is no way to inspect private fields of the Immutable class using reflection, the closest available alternative was to inspect the mutator methods on the Immutable Builder class. But that approach is hacky, because the builder class has additional methods (equals, from, wait and collection utility methods like addAll, remove, set, etc.). Additionally, the builder sometimes has overloaded methods, e.g. if a field is of type Optional. Also, fields annotated with @Gson.Ignore can't be excluded from the schema, when enumerating mutators on the Builder. So far, generating a new _Fields class seems to be the best available option to be able to determine a database schema. See #1129.
The text was updated successfully, but these errors were encountered:
We need the ability to determine the schema of Immutable objects that are persisted in a database like MongoDB. Since there is no way to inspect private fields of the Immutable class using reflection, the closest available alternative was to inspect the mutator methods on the Immutable Builder class. But that approach is hacky, because the builder class has additional methods (equals, from, wait and collection utility methods like addAll, remove, set, etc.). Additionally, the builder sometimes has overloaded methods, e.g. if a field is of type Optional. Also, fields annotated with @Gson.Ignore can't be excluded from the schema, when enumerating mutators on the Builder. So far, generating a new _Fields class seems to be the best available option to be able to determine a database schema. See #1129.
The text was updated successfully, but these errors were encountered: