0

Is it possible to typecast an attribute of an itemtype in ImpEx export script to be fired via Admin Console in Hybris.I wanted to do something like this:

if(student instanceof UGStudent) UGStudent ugStudent = (UGStudent) ugstudent;

so that I can have attributes specific to the subtype as well.

Rachit
  • 403
  • 10
  • 32

1 Answers1

0

I don't understand completely what exactly you are trying to do. May be this can help you.

Export Script :

"#% impex.setLocale( new Locale( ""en"" , """" ) );"

 INSERT_UPDATE UGStudent;uid
 "#% impex.exportItems(""SELECT {pk} FROM {UGStudent}"", Collections.EMPTY_MAP, Collections.singletonList( Item.class ), true, true, -1, -1 );"

You can define UGStudent specific attributes in INSERT_UPDATE.

Free-Minded
  • 5,322
  • 6
  • 50
  • 93
  • Hi, can you tell me what does "!" stand for ? – Hristo Staykov Aug 15 '17 at 20:03
  • 1
    @HristoStaykov I mistakenly added this. In this case "!" not useful. I'll update it. Thanks. By adding a trailing exclamation mark ( ! ), the FlexibleSearch query searches only the specified type and omits all subtypes. For example, the following code snippet searches only instances of Product, not of VariantProduct -- `SELECT {code},{pk} FROM {Product!}` – Free-Minded Aug 16 '17 at 06:19
  • Thank you for you answer :) – Hristo Staykov Aug 16 '17 at 10:10
  • @ShreshttBhatt,suppose there is a scenario whereby the delivery modes have a reference to the Country itemtype.Now there are some attributes in a subclass of Country(say MyCountry).While retrieving information from delivery modes,how do I cast(or typecast) the Country reference to MyCountry – Rachit Nov 03 '17 at 20:57