Skip to content

ReflectionUtils#invokeSetter doesn't consider acessor methods #107

Open
@rafaelingaramo

Description

@rafaelingaramo

Hello,
i've been working with Hybris that is a SAP Product for e-commerces,
that being said, this product generates his Pojo classes without common classes attributes:

`public class DeliveryHandlingModel extends ItemModel{
public final static String _TYPECODE = "DeliveryHandling";
public static final String DELIVERYCOST = "deliveryCost";
public static final String DELIVERYDAYS = "deliveryDays";

public DeliveryHandlingModel()
{
	super();
}

public DeliveryHandlingModel(final ItemModelContext ctx)
{
	super(ctx);
}

@Deprecated
public DeliveryHandlingModel(final ItemModel _owner)
{
	super();
	setOwner(_owner);
}

@Accessor(qualifier = "deliveryCost", type = Accessor.Type.GETTER)
public BigDecimal getDeliveryCost()
{
	return getPersistenceContext().getPropertyValue(DELIVERYCOST);
}

@Accessor(qualifier = "deliveryDays", type = Accessor.Type.GETTER)
public Integer getDeliveryDays()
{
	return getPersistenceContext().getPropertyValue(DELIVERYDAYS);
}

}`

Given the example above the Hybris generates all pojo classes on XML Based configuration, given that there are no common attribute acessors to get and set the fields, the Getter and the Setter uses 'getPersistenceContext().setPropertyValue' to persist into his own customized persistence layer.

All that being said there are no solutions to work with fixtures in Hybris SAP, so i'm proposing to RelectionUtils#invokeSetter to use getter/setter as well with attibutes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions