All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.caucho.amber.cfg.AttributesConfig Maven / Gradle / Ivy

/*
 * Copyright (c) 1998-2018 Caucho Technology -- all rights reserved
 *
 * This file is part of Resin(R) Open Source
 *
 * Each copy or derived work must preserve the copyright notice and this
 * notice unmodified.
 *
 * Resin Open Source is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * Resin Open Source is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, or any warranty
 * of NON-INFRINGEMENT.  See the GNU General Public License for more
 * details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Resin Open Source; if not, write to the
 *
 *   Free Software Foundation, Inc.
 *   59 Temple Place, Suite 330
 *   Boston, MA 02111-1307  USA
 *
 * @author Rodrigo Westrupp
 */

package com.caucho.amber.cfg;

import java.util.HashMap;

/**
 * <attributes> tag in the orm.xml
 */
public class AttributesConfig {

  // no attributes

  // elements
  private HashMap _idMap
    = new HashMap();

  private HashMap _basicMap
    = new HashMap();

  private EmbeddedIdConfig _embeddedId;

  private HashMap _versionMap
    = new HashMap();

  private HashMap _manyToOneMap
    = new HashMap();

  private HashMap _oneToManyMap
    = new HashMap();

  private HashMap _oneToOneMap
    = new HashMap();

  private HashMap _manyToManyMap
    = new HashMap();

  private HashMap _embeddedMap
    = new HashMap();

  private HashMap _transientMap
    = new HashMap();


  /**
   * Adds a new .
   */
  public void addBasic(BasicConfig basic)
  {
    _basicMap.put(basic.getName(), basic);
  }

  /**
   * Returns the  map.
   */
  public HashMap getBasicMap()
  {
    return _basicMap;
  }

  /**
   * Returns a  config.
   */
  public BasicConfig getBasic(String name)
  {
    return _basicMap.get(name);
  }

  /**
   * Adds a new .
   */
  public void addId(IdConfig id)
  {
    _idMap.put(id.getName(), id);
  }

  /**
   * Returns the  map.
   */
  public HashMap getIdMap()
  {
    return _idMap;
  }

  /**
   * Returns an  config.
   */
  public IdConfig getId(String name)
  {
    return _idMap.get(name);
  }

  /**
   * Returns the  config.
   */
  public EmbeddedIdConfig getEmbeddedId()
  {
    return _embeddedId;
  }

  /**
   * Sets the  config.
   */
  public void setEmbeddedId(EmbeddedIdConfig embeddedId)
  {
    _embeddedId = embeddedId;
  }

  public HashMap getVersionMap()
  {
    return _versionMap;
  }

  public void addVersion(VersionConfig version)
  {
    _versionMap.put(version.getName(), version);
  }

  public VersionConfig getVersion(String name)
  {
    return _versionMap.get(name);
  }

  public HashMap getManyToOneMap()
  {
    return _manyToOneMap;
  }

  public void addManyToOne(ManyToOneConfig manyToOne)
  {
    _manyToOneMap.put(manyToOne.getName(), manyToOne);
  }

  public ManyToOneConfig getManyToOne(String name)
  {
    return _manyToOneMap.get(name);
  }

  public HashMap getOneToManyMap()
  {
    return _oneToManyMap;
  }

  public void addOneToMany(OneToManyConfig oneToMany)
  {
    _oneToManyMap.put(oneToMany.getName(), oneToMany);
  }

  public OneToManyConfig getOneToMany(String name)
  {
    return _oneToManyMap.get(name);
  }

  public HashMap getOneToOneMap()
  {
    return _oneToOneMap;
  }

  public void addOneToOne(OneToOneConfig oneToOne)
  {
    _oneToOneMap.put(oneToOne.getName(), oneToOne);
  }

  public OneToOneConfig getOneToOne(String name)
  {
    return _oneToOneMap.get(name);
  }

  public HashMap getManyToManyMap()
  {
    return _manyToManyMap;
  }

  public void addManyToMany(ManyToManyConfig manyToMany)
  {
    _manyToManyMap.put(manyToMany.getName(), manyToMany);
  }

  public ManyToManyConfig getManyToMany(String name)
  {
    return _manyToManyMap.get(name);
  }

  public HashMap getEmbeddedMap()
  {
    return _embeddedMap;
  }

  public void addEmbedded(EmbeddedConfig embedded)
  {
    _embeddedMap.put(embedded.getName(), embedded);
  }

  public EmbeddedConfig getEmbedded(String name)
  {
    return _embeddedMap.get(name);
  }

  public HashMap getTransientMap()
  {
    return _transientMap;
  }

  public void addTransient(TransientConfig transientConfig)
  {
    _transientMap.put(transientConfig.getName(), transientConfig);
  }

  public TransientConfig getTransient(String name)
  {
    return _transientMap.get(name);
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy