Skip to content

Add support for inner class mappings to code generation #4

@absolutedogy

Description

@absolutedogy

When generating the mapping for an inner class, there are two additional checks that need to be handled

The first is that when assigning the top level path of the inner class, it will give us a boolean value which is considered a "isSet" flag which will tell us if we need to instantiate the object or not.

After isSet is parsed, there will be the need to read the rest of the path as a new path that gets passed into the inner parser.

The logic should look something like this given we have an sub entity at path 0 of the base object, and that inner object has an int32 at it's 0 index

case 0
   if path.length = 1
      fieldAt0 = new innerEntity()
   else 
      fieldAt0.UpdateProperty(path[1..], value)

This is basically saying, if this is directly referencing the top level entity instantiate it, otherwise pass the value down to the inner entity

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions