Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ReflectionUtils#invokeSetter doesn't consider acessor methods #107

Open
rafaelingaramo opened this issue May 17, 2019 · 0 comments
Open

Comments

@rafaelingaramo
Copy link

rafaelingaramo commented May 17, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant