SubContextEntity.java

  1. package org.exoplatform.settings.chromattic;

  2. import org.chromattic.api.annotations.OneToMany;
  3. import org.chromattic.api.annotations.PrimaryType;

  4. import java.util.Map;

  5. /**
  6.  * @author <a href="mailto:alain.defrance@exoplatform.com">Alain Defrance</a>
  7.  */
  8. @PrimaryType(name = "stg:subcontext")
  9. public abstract class SubContextEntity extends ContextEntity {

  10.   @OneToMany
  11.   public abstract Map<String, SimpleContextEntity> getContexts();

  12.   public SimpleContextEntity getContext(String contextName) {
  13.     return getContexts().get(contextName);
  14.   }

  15. }