Visitar URL original
Feature Request: Make interface @IgnoreSave use @Target({ElementType.TYPE, ElementType.FIELD}) · Issue #507 · objectify/objectify · GitHub
Skip to content

Feature Request: Make interface @IgnoreSave use @Target({ElementType.TYPE, ElementType.FIELD}) #507

Description

@naturalstars

Feature request to make interface @IgnoreSave use @target({ElementType.TYPE, ElementType.FIELD}) so that you can just put it at the top of the class, instead of having to set it on each field.

Activity

  1. stickfigure commented on Jun 3, 2024

    @stickfigure
    Contributor

    Presumably this would also require some sort of @DontIgnoreSave annotation as well to reverse the behavior? Right now there is no annotation for "do save this" since everything is saved by default.

  2. naturalstars commented on Jun 4, 2024

    @naturalstars
    Author

    Possibly? I personally don't think I would use a @DontIgnoreSave because I don't want nulls all over the place in my Datastore, but maybe others might if they want to query on nulls.

  3. naturalstars commented on Jun 5, 2024

    @naturalstars
    Author

    Another reason for @DontIgnoreSave is to save space on entity field names when they are null. If you have field names that are long (as in many characters), when you save a null, it saves many bytes for the field name (and only 1 for the null). At scale, this can add up to a lot of bytes, depending on how many characters your field names are. Better to just not save that field at all and assume it is String.empty or Boolean.false.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions