Is their a way to populate only simple properties and not the object graph?

25 views
Skip to first unread message

Ravi Hasija

unread,
Mar 16, 2018, 12:25:47 PM3/16/18
to PODAM
Hello,

Is their a way to not populate the entire object graph but just simple properties?

For example:

Account {

   String foo, bar;
   Customer customer;
}

Is their a way to only populate foo and bar and not customer?

Thanks in advance!


Ravi Hasija

Daniil Ivanov

unread,
Mar 17, 2018, 8:24:26 AM3/17/18
to PODAM
Hi,

There are several ways to do that.
The easiest one would be to make your own ObjectTypeManufacturer, which will return null in getType(...) method and register it to your factory.

factory.getStrategy().addOrReplaceTypeManufacturer(Object.class, objectTypeManufacturer);

Something similar is described in the documentation, where string instantiation is customized.
https://mtedone.github.io/podam/#Defining_an_attribute-level_strategy_with_DataProviderStrategy

However, I'm not sure why anyone would want to have all composite types empty. I suppose you
are actually trying to achieve something else.

Thanks, Daniil
Reply all
Reply to author
Forward
0 new messages