Page 1 of 1

Extending relation for existing entity

Posted: Mon Mar 31, 2014 8:43 pm
by realstone
Hi,

I would like to extend the default Sku to have one more one-to-many relation. For example Sku to Locale relation.

One Sku many have many locales. I know I can extend the SkuImpl class from the doc, however the extending either requires a new table or a discriminator column for join and single table inheritance. My case is not to add any table or column. It is just to add one more foreign key and add a collection property to Sku entity.

Is there any way rather than to entirely replace the existing Sku class?

Thanks,

Re: Extending relation for existing entity

Posted: Tue Apr 01, 2014 12:06 pm
by phillipuniverse
You could use byte-code weaving. There are not any docs for this but you can see how it is implemented in the inventory class transformer in the 3.1.0-GA workspace and the offer audit class transformer in the 3.0.10-GA workspace. Both of the class transformers are configured in core/src/main/resources/applicationContext.xml.