Page 1 of 1

Single table inheritance without using JVM param

Posted: Thu Jul 02, 2015 4:17 pm
by dnik
This tutorial offers a solution for overriding the default annotation InheritanceType.JOINED on ProductImpl and setting it to InheritanceType.SINGLE_TABLE: http://www.broadleafcommerce.com/docs/core/current/tutorials/core-tutorials/extending-entities-tutorial#single-table-inheritance

The solution involves using JVM parameters, however we won't be able to use that solution in our environment since we've set up automated updates to our servers that will wipe out any settings. Is there another way to override the inheritance strategy that doesn't involve setting JVM arguments and doesn't require making any changes to the Broadleaf code?

My goal is to extend SkuImpl with an Entity that doesn't have a table in the database. I'd like to add extra fields with mappings that require BLC_SKU. The simplest solution was to extend SkuImpl and change the inheritance strategy to SINGLE_TABLE, but I'd like to try to achieve that without touching Broadleaf code.

Thanks for any help you can offer!

Re: Single table inheritance without using JVM param

Posted: Sun Jul 05, 2015 11:52 pm
by phillipuniverse
No, your only option is to add the Spring Instrument jar as a JVM parameter for -javaagent.

Not being able to set JVM parameters seems odd to me, and I'm not sure how setting up automated updates to your servers will wipe out any of those settings. Why can't your automated updates preserve settings like that? Are you also not specifying any other JVM parameters like max heap size?

Re: Single table inheritance without using JVM param

Posted: Tue Jul 21, 2015 10:02 am
by dnik
Thanks for the reply.

Unfortunately it was just something we were told from on high, it's not something we have control over. If we can make a good case that there's no other alternative then we might be able to add the arguments and put something in place to preserve them. For now though we'll be looking at any other solution without having to ruffle the chain. Just the nature of the job :/

Re: Single table inheritance without using JVM param

Posted: Mon Jul 27, 2015 4:54 am
by phillipuniverse
looking at any other solution without having to ruffle the chain


Good luck, I am highly skeptical you will be able to find anything. At a minimum, you will need to pass the spring-instrument jar as a -javaagent parameter to the JVM. There is no other possible way to get that to work otherwise.