Skip to content

C# to Java type mapping #1643

Closed
Closed
@niemyjski

Description

@niemyjski

I have a dictionary that I do dynamic mapping on in our app. I append a type suffix to the field name so I can share mappings (multi tenant). Currently I'm only handling decimal and double mappings in .net and this leads to some insert errors when I detect it incorrectly (obviously a bug on our part).. I think the solutions for us going forward is to have a typed field mapping based on the suffix that maps to the largest numeric type (sucks because you use more memory) or parse out the specific type (and use more processing time).

I wanted to look through your code to see if I could find a method where I could pass a type/instance or string (do a parse of the type for me) and return the name it would be mapped to (E.G., number). I came across this and this in master. To my knowledge, correct me if I'm wrong.. seem to incorrectly handle some data types incorrectly or not at all. For example it doesn't seem like some data types are handled like DateTimeOffset and possibly some numeric types. Secondly the java types as defined here don't match up with your .NET data type mappings. Example:

Java byte is -128 to 127 which is the same as a .NET SByte. In the code I saw you had it mapped to a .NET Byte as well which is 0-255. Which I believe the methods would return the incorrect mapping if the value is >127.

Would it be possible to expose some helper methods that make it easier to get the mapped types as well as update these mappings?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions