Package nexj.core.meta

Examples of nexj.core.meta.MetadataException


   {
      verifyNotReadOnly();
     
      if (sClientId != null && !m_bBroadcast)
      {
         throw new MetadataException("err.meta.integration.mq.clientId",
            new Object[]{m_sName});
      }

      m_sClientId = sClientId;
   }
View Full Code Here


     
      if (oldColumn != null)
      {
         m_columnMap.put(column.getName(), oldColumn);

         throw new MetadataException("err.meta.columnDup", new Object[]{column.getName(), getName()});
      }

      column.setOrdinal(m_columnList.size());
      m_columnList.add(column);
      column.setTable(this);
View Full Code Here

      switch (m_nNodeType)
      {
         case ATTRIBUTE:
            if (parentPart == null)
            {
               throw new MetadataException("err.meta.integration.xml.rootNotElement",
                  new Object[]{part.getFullPath()});
            }

            if (compositePart != null)
            {
               throw new MetadataException("err.meta.integration.xml.compositeAttribute",
                  new Object[]{part.getFullPath()});
            }

            if (part.isCollection())
            {
               throw new MetadataException("err.meta.integration.xml.collectionAttribute",
                  new Object[]{part.getFullPath()});
            }

            if (m_bNillable)
            {
               throw new MetadataException("err.meta.integration.xml.misplacedNillable",
                  new Object[]{part.getFullPath()});
            }

            break;

         case VALUE:
            if (parentPart == null)
            {
               throw new MetadataException("err.meta.integration.xml.rootNotElement",
                  new Object[]{part.getFullPath()});
            }

            if (compositePart != null)
            {
               throw new MetadataException("err.meta.integration.xml.compositeValue",
                  new Object[]{part.getFullPath()});
            }

            if (part.isCollection() && primitivePart.getType() != Primitive.ANY)
            {
               throw new MetadataException("err.meta.integration.xml.collectionValue",
                  new Object[]{part.getFullPath()});
            }

            if (parentMapping.getValuePart() != null)
            {
               throw new MetadataException("err.meta.integration.xml.duplicateElementValueMapping",
                  new Object[]{part.getFullPath()});
            }

            parentMapping.m_valuePart = primitivePart;

            if (m_bNillable)
            {
               throw new MetadataException("err.meta.integration.xml.misplacedNillable",
                  new Object[]{part.getFullPath()});
            }

            break;

         case ELEMENT:
            if (m_bNillable && part.isRequired())
            {
               throw new MetadataException("err.meta.integration.xml.requiredNillable",
                  new Object[]{part.getFullPath()});
            }

            break;
      }

      if (m_nSubtype != SUBTYPE_DEFAULT && m_sFormat != null)
      {
         throw new MetadataException("err.meta.integration.xml.formatSubtype",
            new Object[]{part.getFullPath()});
      }

      boolean bSubtypeValid;

      if (primitivePart != null)
      {
         switch (primitivePart.getType().getOrdinal())
         {
            case Primitive.BINARY_ORDINAL:
               switch (m_nSubtype)
               {
                  case SUBTYPE_DEFAULT:
                     m_nSubtype = SUBTYPE_BASE64;

                  case SUBTYPE_BASE64:
                  case SUBTYPE_HEX:
                     bSubtypeValid = true;
                     break;

                  default:
                     bSubtypeValid = false;
                     break;
               }

               break;

            case Primitive.TIMESTAMP_ORDINAL:
               switch (m_nSubtype)
               {
                  case SUBTYPE_DEFAULT:
                     m_nSubtype = SUBTYPE_DATETIME;

                  case SUBTYPE_DATE:
                  case SUBTYPE_TIME:
                  case SUBTYPE_DATETIME:
                     bSubtypeValid = true;
                     break;

                  default:
                     bSubtypeValid = false;
                     break;
               }

               break;

            case Primitive.ANY_ORDINAL:
               bSubtypeValid = m_nSubtype == SUBTYPE_DEFAULT || m_nSubtype == SUBTYPE_XSI && m_nNodeType == ELEMENT;
               break;

            default:
               bSubtypeValid = m_nSubtype == SUBTYPE_DEFAULT;
               break;
         }
      }
      else
      {
         bSubtypeValid = m_nSubtype == SUBTYPE_DEFAULT;

         if (m_sFormat != null)
         {
            throw new MetadataException("err.meta.integration.formatComposite",
               new Object[]{part.getFullPath()});
         }
      }

      if (!bSubtypeValid)
      {
         throw new MetadataException("err.meta.integration.xml.inapplicableSubtype",
            new Object[]{SUBTYPE_NAMES[m_nSubtype], part.getFullPath()});
      }

      MessagePart rootPart = part.getRoot();
      RootXMLMessagePartMapping rootMapping = (RootXMLMessagePartMapping)rootPart.getMapping();
View Full Code Here

      verifyNotReadOnly();
      index.setTable(this);

      if (!index.isAspect() && index.getIndexColumnCount() == 0)
      {
         throw new MetadataException("err.meta.noIndexColumns");
      }

      if (index.getType() == Index.CLUSTER)
      {
         for (int i = getIndexCount() - 1; i >= 0; --i)
         {
            Index other = getIndex(i);

            if (other.getType() == Index.CLUSTER && other != index)
            {
               throw new MetadataException("err.meta.dupClusteredIndex",
                  new Object[]{index.getName(), getName()});
            }
         }
      }
View Full Code Here

         m_mappingMap.put(mapping.getPersistenceMapping(), mappings);
      }

      if (mappings[mapping.getColumn().getOrdinal()] != null)
      {
         throw new MetadataException("err.meta.dupColumnMapping",
            new Object[]{mapping.getAttribute().getName(),
               mapping.getAttribute().getMetaclass().getName(),
               mapping.getColumn().getName(), getName(),
               mappings[mapping.getColumn().getOrdinal()].getAttribute().getName()});
      }
View Full Code Here

   {
      verifyNotReadOnly();

      if (isAspect())
      {
         throw new MetadataException("err.meta.nestedTableAspect",
            new Object[]{m_sName});
      }

      if (!aspect.isAspect())
      {
         throw new MetadataException("err.meta.tableAspectType",
            new Object[]{aspect.getName(), m_sName});
      }

      if (m_pointcutHelper == null)
      {
View Full Code Here

   {
      verifyNotReadOnly();

      if (!isAspect())
      {
         throw new MetadataException("err.meta.tablePointcut",
            new Object[]{m_sName});
      }

      if (m_aspectHelper == null)
      {
View Full Code Here

      if (m_viewScript != null)
      {
         if (m_nType != QUERY && m_nType != VIEW)
         {
            throw new MetadataException("err.meta.viewTableType", new Object[]{m_sName});
         }

         try
         {
            m_viewScript.validate(m_schema, this, null);
         }
         catch (UncheckedException e)
         {
            MetadataValidationException x = new MetadataValidationException(e);

            setProperties(x);

            throw x;
         }
      }
      else if (getType() == QUERY || getType() == VIEW)
      {
         throw new MetadataException("err.meta.viewTableScript", new Object[]{m_sName});
      }

      // validate that all specified hints are valid/defined
      if (m_hintSet != null && !m_hintSet.isEmpty())
      {
         MetadataCompoundValidationException eh = null;

         for (Iterator/*<String>*/ itr = m_hintSet.iterator(); itr.hasNext();)
         {
            String sHint = itr.next().toString();

            if (!m_schema.isHintSupported(sHint))
            {
               eh = addException(
                  eh, new MetadataException("err.meta.tableHint", new Object[]{sHint, m_sName}));
            }
         }

         if (eh != null)
         {
View Full Code Here

         {
            public void fixup()
            {
               if (attribute.getType().isPrimitive())
               {
                  throw new MetadataException("err.meta.primitiveReverseAttrib",
                     new Object[]{sReverseName, attribute.getName(),
                        attribute.getMetaclass().getName()});
               }

               attribute.setReverse(((Metaclass)attribute.getType()).getAttribute(sReverseName));
View Full Code Here

         {
            e = new MetadataCompoundValidationException();
         }

         e.addException(
            new MetadataException("err.meta.argLookup", new Object[]{itr.next(), event}));
      }

      if (e != null)
      {
         throw e;
View Full Code Here

TOP

Related Classes of nexj.core.meta.MetadataException

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.