Skip to Content
author's profile photo Former Member
Former Member

How to create a generic populator

Hi experts,

I have some requirement.like this,

example : i want to convert C--->A type and C--->B type.

For C to A type, i had already a populator. so do i need a another populator for C to B type,or can i create a generic populator. where destination will be generic.

Please suggest me how to create a generic populator.

Thanks in advance.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Oct 13, 2015 at 10:18 AM

    To me a generic populator makes limited sense and usually you want to control which attributes you want to convert. Otherwise the whole populator mechanism was generic and would simply publish any attributes.

    Aside of that you could look into generics / reflection and populate matching attibutes (another thing that usually the attributes are not guaranteed to be named the same).

    Or you set up a configuration mechanism specifying the source/target fields. That could simply be property file entries like target.targetattribute=source.sourceattribute. Or an xml that you parse yourself.

    The configuration approach for me only makes sense if you need a larger number of populators, if you need two or three it's still easier to just write them individually.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.