Package org.objectweb.speedo.api

Examples of org.objectweb.speedo.api.SpeedoRuntimeException


     * @exception SpeedoRuntimeException if the object is not persistence capable.
     */
    protected void assertIsPO(Object pc, String cmd) {
        if (!(pc instanceof PersistentObjectItf)) {
      if (pc == null) {
        throw new SpeedoRuntimeException("Null persistent object instance specified");
      } else if (pc.getClass().isArray()
        || pc instanceof Collection) {
        throw new SpeedoRuntimeException("You must use the " + cmd
          + "All method with a multivalued parameter: " + pc);
      } else {
              throw new SpeedoRuntimeException("The object is not a PersistentObjectItf, beware to : " + pc);
      }
    }
    }
View Full Code Here


                try {
                    tpm.readIntention(tx, sp, null);
                } catch (RolledBackPersistenceException e) {
                    throw ((JDOTransactionItf) tx).rollBackOnInternalError(e);
                } catch (PersistenceException e) {
                    throw new SpeedoRuntimeException("Impossible to add the " +
                            "persistent object into the working set", e);
                }
            } else {
                throw new SpeedoRuntimeException(
                    "Object not managed by this persistence manager, object: "
                    + sp);
            }
        }
    }
View Full Code Here

        return field & column;
    }
   
    public void setDiscriminatorValue(Object value, SpeedoInheritance si, SpeedoElement elem) {
        if (!elements.contains(elem)) {
            throw new SpeedoRuntimeException(elem
                    + " has not been defined as discriminator part for the class "
                    + si.clazz.getFQName());
        }
        if (si.discriminatorValues == null) {
            si.discriminatorValues = new HashMap();
View Full Code Here

    public SpeedoInheritedField newSpeedoInheritedField(String fieldName)
        throws SpeedoRuntimeException {
        SpeedoField sf = clazz.getField(fieldName);
        //check that the persistent field exists
        if (sf == null) {
            throw new SpeedoRuntimeException("Field '" + fieldName
                    + "' has not been found in the inheritance tree from the class '"
                    + clazz.getFQName() + "'.");
        }
        return newSpeedoInheritedField(sf);
    }
View Full Code Here

    public SpeedoInheritedField newSpeedoInheritedField(SpeedoField sf)
      throws SpeedoRuntimeException {
      //check that the persistent field exists
      // checks that the field comes from an ancestor.
      if (sf.moClass == clazz) {
          throw new SpeedoRuntimeException("Field '" + sf.name
                  + "' is not an inherited field, because it is defined in the current class '"
                  + clazz.getFQName() + "'.");
      }
      //create the meta object and fill it.
      SpeedoInheritedField sif = new SpeedoInheritedField();
View Full Code Here

        return sb.toString();
    }

    public void addColumn(SpeedoColumn col) {
        if (col == null) {
            throw new SpeedoRuntimeException(
                    "try to add a null column into " + getSourceDesc());
        }
        columns = (SpeedoColumn[]) addInArray(col, columns, SpeedoColumn[].class);
    }
View Full Code Here

            }
            POManagerItf mypm = pm;
      if (mypm == null) {
                mypm = thepo.speedoGetPOManager();
                if (mypm == null) {
                    throw new SpeedoRuntimeException(
                        "When a persistent object is used (read or write), " +
                        "a PersistenceManager is needed");
                }
      }
            mypm.speedoMakePersistent(sp, map);
View Full Code Here

            Object o = null;
            try {
                o = idclass.getConstructor(new java.lang.Class[]{String.class})
                        .newInstance(new Object[]{(String) oid});
            } catch (Exception e) {
                throw new SpeedoRuntimeException("No constructor with a String " +
                        "parameter available on the identifier class: "
                        + idclass.getName());
            }
            //recall with the UserId
            return decode(pnc, o, clazz, jf);
View Full Code Here

    //  deserialize the JMI from the file
    Set mos = null;
    try {
      mos = (Set) Object2StringSerializer.deserialize(fileName, classLoader, null);
    } catch (Exception e) {
      throw new SpeedoRuntimeException("Impossible to load the jorm meta " +
          "information from the file " + fileName + "' (You must use the same Speedo version for the"
          + " enhancement and for the runtime): ", e);
    }
    //select only the sequences and indexes and deserialize them
    for (Iterator it = mos.iterator(); it.hasNext();) {
View Full Code Here

            System.arraycopy(array, 0, newArray, 0, array.length);
            newArray[array.length] = value;
        }
        for (int i = 0; i < newArray.length; i++) {
            if (newArray[i] == null) {
                throw new SpeedoRuntimeException("a null element found: " + i);
            }
        }
        return newArray;
    }
View Full Code Here

TOP

Related Classes of org.objectweb.speedo.api.SpeedoRuntimeException

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.