Uploaded image for project: 'Polygene'
  1. Polygene
  2. POLYGENE-22

Add toValue() and toEntity() methods to the Qi4j API.

    XMLWordPrintableJSON

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.1
    • Labels:
      None

      Description

      Rickard added the support for handling Associations in Values, and we also now have the full support of sharing super-types between Entities and Values.

      So, it would make sense that if I declare the assembly;

      module.entities( Person.class );
      module.values( Person.class );

      that I could do;

      Person entity = ...;
      Person value = api.toValue( Person,class, entity );

      as well as the other way around;

      Person value = ...;
      Person entity = api.toEntity( Person.class, entity );

      The implementation of this is fairly small and straight forward, and I have most of it in place in my project already, but I think it really belongs in the API itself, as this would be super-neat for Rest APIs and other work outside of UnitOfWorks.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                niclas Niclas Hedhman
                Reporter:
                niclas Niclas Hedhman
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: