Package org.apache.empire.exceptions

Examples of org.apache.empire.exceptions.ItemExistsException


    protected void addColumn(DBTableColumn column)
    { // find column by name
        if (column==null || column.getRowSet()!=this)
            throw new InvalidArgumentException("column", column);
        if (getColumn(column.getName())!=null)
            throw new ItemExistsException(column.getName());
        // add now
        columns.add(column);
    }
View Full Code Here


        String name = index.getName();
        for (DBIndex i : indexes)
        {
            if (i==index || name.equalsIgnoreCase(i.getName()))
            {
                throw new ItemExistsException(name);
            }
        }       
        // add Index now
        indexes.add(index);
        index.setTable(this);
View Full Code Here

    protected void addColumn(DBViewColumn col)
    { // find column by name
        if (col == null || col.getRowSet() != this)
            throw new InvalidArgumentException("col", col);
        if (getColumn(col.getName())!=null)
            throw new ItemExistsException(col.getName());
        // add now
        columns.add(col);
    }
View Full Code Here

    protected void addTable(DBTable table)
    { // find column by name
        if (table == null || table.getDatabase() != this)
            throw new InvalidArgumentException("table", table);
        if (tables.contains(table)==true)
            throw new ItemExistsException(table.getName());
        // Check for second instances
        DBTable existing = getTable(table.getName());
        if (existing!=null)
        {   // Check classes
            if (existing.getClass().equals(table.getClass()))
                return; // Ignore other instances
            // Table exists with different class
            throw new ItemExistsException(table.getName());
        }
        // add now
        tables.add(table);
    }
View Full Code Here

     */
    public DBRelation addRelation(String name, DBRelation.DBReference... references)
    {
      // Check
      if (getRelation(name)!=null)
            throw new ItemExistsException(name); // Relation already exists
      // Get default cascade action
      DBTable targetTable = (DBTable)references[0].getTargetColumn().getRowSet();
      DBCascadeAction deleteAction = targetTable.getDefaultCascadeDeleteAction();
        // Add a Relation
        DBRelation relation = new DBRelation(this, name, references, deleteAction);
        if (relations.contains(relation))
            throw new ItemExistsException(name); // Relation already exists
        // Add Reference column to table
        for (DBRelation.DBReference ref : references)
        {   // add the reference column
            DBRowSet rset = ref.getSourceColumn().getRowSet();
            rset.addColumnReference(ref.getSourceColumn(), ref.getTargetColumn());
View Full Code Here

    protected void addView(DBView view)
    { // find column by name
        if (view == null || view.getDatabase() != this)
            throw new InvalidArgumentException("view", view);
        if (views.contains(view) == true)
            throw new ItemExistsException(view.getName());
        // add now
        views.add(view);
    }
View Full Code Here

    FacesContext  fc = FacesContext.getCurrentInstance();
    RuntimeConfig rc = RuntimeConfig.getCurrentInstance(fc.getExternalContext());
    // check
        if (rc.getManagedBeans().containsKey(beanName))
        {
            throw new ItemExistsException(beanName);
        }
        // register now
        ManagedBean mbi = new ManagedBean();
        mbi.setName(beanName);
        mbi.setBeanClass(beanClass);
View Full Code Here

  public void registerManagedBean(final String beanName,final String beanClass,final String scope)
  {
    // check
        if (bm.getRegisteredBeans().containsKey(beanName))
        {
            throw new ItemExistsException(beanName);
        }
        // register now
        ManagedBeanInfo mbi = new ManagedBeanInfo(beanName, beanClass, "view", null, null, null, null);
        bm.register(mbi);
  }
View Full Code Here

        if (ext>0)
          name = name.substring(0,ext);
        // Check Name
        if (pageMap.containsKey(name))
        {
            throw new ItemExistsException(name);
        }
        log.info("Registering view '{}'.", name);
        // Register Name
        pageMap.put(name, pageDef);
    }
View Full Code Here

    @Override
    public void setApplication(Application application)
    {
        if (this.application != null)
            throw new ItemExistsException(this.application);
        if (!(application instanceof FacesApplication))
            throw new InvalidArgumentException("application", application);
        this.application = (FacesApplication)application;
    }
View Full Code Here

TOP

Related Classes of org.apache.empire.exceptions.ItemExistsException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.