Skip to content

Feature Request support annotations to multiple classes #3

@GoogleCodeExporter

Description

@GoogleCodeExporter
Currently to map from a class into a class you use the following annotations

@Mappable
public class Bean2 {

        /** The name. */
        @Source(type = org.omapper.test.Bean1.class, property = "name")
        private String name;
}

But what if you wanted to support a conversion from Bean3 you might write 
something like:

@Mappable
public class Bean2 {

        /** The name. */
        @Source(type = org.omapper.test.Bean2.class, property = "bean2Name")
        @Source(type = org.omapper.test.Bean1.class, property = "name")
        private String name;
}

however that is not allowed in Java.  One possible solution is to add an 
annotation that takes annotations as arguments:

@Mappable
public class Bean2 {

        /** The name. */
        @Sources({
        @Source(type = org.omapper.test.Bean2.class, property = "bean2Name"),
        @Source(type = org.omapper.test.Bean1.class, property = "name")})
        private String name;
}

Original issue reported on code.google.com by michael....@gmail.com on 22 Aug 2014 at 9:05

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions