on ‎2018 Oct 24 10:20 AM
The type QuotationOrder must implement the inherited abstract method AbstractOrder.createNewEntry(SessionContext, ComposedType, Product, long, Unit, int) The type QuotationOrder must implement the inherited abstract method AbstractOrder.getAbstractOrderEntryTypeCode()
Request clarification before answering.
AbstractOrder is an abstract class which contains abstract method createNewEntry. So, if you extend AbstractOrder, you need to implement the abstract method. Otherwise, you need to define your class as abstract.
public class QuotationOrder {
protected OrderEntry createNewEntry(SessionContext ctx, ComposedType entryType, Product product, long quantity, Unit unit, int position) {
// custom logic
}
}
You could try to check/decompile the de.hybris.platform.jalo.order.Order class for an idea, or you can just do a super in your constructor.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
There are two options: (1) Extend Order instead of AbstractOrder e.g.
<itemtype code="QuotationOrder"
extends="Order"
jaloclass="org.training.jalo.order.QuotationOrder"
autocreate="true"
generate="true">
<attributes>
<attribute autocreate="true" qualifier="sampleStringAttribute" type="java.lang.String">
<persistence type="property"/>
<modifiers read="true" write="true" search="true" optional="false"/>
</attribute>
</attributes>
</itemtype>
(2) Extend AbstractOrder as follows
<itemtype code="CustomOrder"
extends="AbstractOrder"
jaloclass="org.training.jalo.order.CustomOrder"
autocreate="true"
generate="true">
<attributes>
<attribute autocreate="true" qualifier="sampleStringAttribute" type="java.lang.String">
<persistence type="property"/>
<modifiers read="true" write="true" search="true" optional="false"/>
</attribute>
</attributes>
</itemtype>
perform ant clean all and update the generated CustomOrder.java to implement the abstract methods ( createNewEntry and getAbstractOrderEntryTypeCode ) of AbstractOrder:
package org.training.jalo.order;
//For brevity, import statements have been removed
public class CustomOrder extends GeneratedCustomOrder {
@SuppressWarnings("unused")
private static final Logger LOG = Logger.getLogger( CustomOrder.class.getName() );
@Override
protected Item createItem(final SessionContext ctx, final ComposedType type, final ItemAttributeMap allAttributes) throws JaloBusinessException {
final Item item = super.createItem( ctx, type, allAttributes );
return item;
}
@Override
protected AbstractOrderEntry createNewEntry(final SessionContext arg0, final ComposedType arg1, final Product arg2, final long arg3, final Unit arg4, final int arg5) {
return null; //replace null with the required value
}
@Override
protected String getAbstractOrderEntryTypeCode() {
return null; //replace null with the required value
}
}
Before adding these methods, you will see the following compilation errors which will go away after adding these methods and then performing ant clean all :
[yjavac] ----------
[yjavac] 1. ERROR in hybris/bin/custom/training/src/org/training/jalo/order/CustomOrder.java (at line 9)
[yjavac] public class CustomOrder extends GeneratedCustomOrder
[yjavac] ^^^^^^^^^^^
[yjavac] The type CustomOrder must implement the inherited abstract method AbstractOrder.createNewEntry(SessionContext, ComposedType, Product, long, Unit, int)
[yjavac] ----------
[yjavac] 2. ERROR in hybris/bin/custom/training/src/org/training/jalo/order/CustomOrder.java (at line 9)
[yjavac] public class CustomOrder extends GeneratedCustomOrder
[yjavac] ^^^^^^^^^^^
[yjavac] The type CustomOrder must implement the inherited abstract method AbstractOrder.getAbstractOrderEntryTypeCode()
[yjavac] ----------
[yjavac] 2 problems (2 errors)
I hope it helps.
Best regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I hope you are aware that the platform supports quotes out-of-the-box since 6.3...
https://help.hybris.com/1808/hcd/a795b4722f6942c091ef716c66ddb37d.html
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.