org.broadleafcommerce.common.sandbox.domain
Class SandBoxManagementImpl

java.lang.Object
  extended by org.broadleafcommerce.common.sandbox.domain.SandBoxManagementImpl
All Implemented Interfaces:
AdminMainEntity, SandBoxManagement

@Entity
public class SandBoxManagementImpl
extends Object
implements AdminMainEntity, SandBoxManagement

This class is required mostly as a workaround for an issue in Hibernate. It's obscure, but I'll try to explain. SandBox ids are used as discriminators in workflow. SandBoxes themselves are also able to be managed in the admin (add new sandbox, etc...) Site ids are used as discriminators in multitenant. When workflow and multitenant are used together, both discriminators are in effect. Because sandboxes can be managed in the admin, it is required that they have a site discriminator to be managed in the multitenant admin. This intermingling of references ends up causing this exception at runtime during, for example, a product save: HibernateException: Found two representations of same collection To workaround, we use this management entity that exposes the properties seamlessly of SandBox to the admin, but holds the site discriminator on its own table (rather than BLC_SANDBOX), which fixes the issue.

Author:
Jeff Fischer

Field Summary
protected  Long id
           
protected  SandBox sandBox
           
 
Fields inherited from interface org.broadleafcommerce.common.admin.domain.AdminMainEntity
MAIN_ENTITY_NAME_PROPERTY
 
Constructor Summary
SandBoxManagementImpl()
           
 
Method Summary
 String getMainEntityName()
           
 SandBox getSandBox()
           
 void setSandBox(SandBox sandBox)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

id

protected Long id

sandBox

protected SandBox sandBox
Constructor Detail

SandBoxManagementImpl

public SandBoxManagementImpl()
Method Detail

getMainEntityName

public String getMainEntityName()
Specified by:
getMainEntityName in interface AdminMainEntity
Returns:
the display name of this entity for the admin screen

getSandBox

public SandBox getSandBox()
Specified by:
getSandBox in interface SandBoxManagement

setSandBox

public void setSandBox(SandBox sandBox)
Specified by:
setSandBox in interface SandBoxManagement


Copyright © 2013. All Rights Reserved.