Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Support for Mapping from Map<String, ???> to Bean #1075

Copy link
Copy link
@twothe

Description

@twothe
Issue body actions

Refering to Stack-Overflow

The situation is: I have a REST service that must be called with a huge amount of parameters (as by customer request) and those should be stored in a database. The easiest way to do that would be to take the parameter map and map that to an entity object. As it is about the same type of code to map from an object to and object or from a map to an object I assume it should not be too difficult to allow mapping like this:

public MyEntity mapToEntity(final Map<String, String> parameters);

Essentially that should turn into code like this:

myEntity.setName( parameters.get("name") );
myEntity.setReferrer( stringToReferrer( parameters.get("referrer") ) );
//...

It would be nice to have other variable types supported as well, like Map<String, Object>, but I am not sure at which point it becomes too complicated.

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.