Package com.sun.jdo.api.persistence.model

Examples of com.sun.jdo.api.persistence.model.Model


  {
    return new ValidationComponent ()
    {
      public void validate () throws ModelValidationException
      {
        Model model = getModel();
        Object pcClass = null;

        if (className == null)
          return;
        pcClass = model.getClass(className);
        if (pcClass == null)
          return;

        if (model.implementsInterface(pcClass, "java.io.Serializable")) //NOI18N
        {
          // check readObject method
          Object readMethod = model.getMethod(className,
            "readObject", Model.getReadObjectArgs()); //NOI18N

          if (!matchesMethod(readMethod, Modifier.PRIVATE,
            Modifier.SYNCHRONIZED, "void")) // NOI18N
          {
            throw new ModelValidationException(pcClass,
              I18NHelper.getMessage(getMessages(),
              "util.validation.class_readobject", //NOI18N
              className));
          }
         
          // check writeObject method
          Object writeMethod = model.getMethod(className,
            "writeObject", Model.getWriteObjectArgs()); //NOI18N

          if (!matchesMethod(writeMethod, Modifier.PRIVATE,
            Modifier.SYNCHRONIZED, "void")) // NOI18N
          {
View Full Code Here


  {
    boolean matches = false

    if (method != null)
    {
      Model model = getModel();
      int modifiers = model.getModifiers(method);

      matches = (((modifiers == expectedModifiers) ||
        (modifiers == (expectedModifiers | optionalModifiers))) &&
        expectedReturnType.equals(model.getType(method)));
    }

    return matches;
  }
View Full Code Here

      (field instanceof MappingRelationshipElement));
  }

  private boolean shouldBeRelationship (PersistenceFieldElement field)
  {
    Model model = getModel();
    String fieldType = model.getFieldType(getClassName(), field.getName());

    return (isPersistent(fieldType) || model.isCollection(fieldType));
  }
View Full Code Here

    return (isRelationship(field) ? shouldBeRelationship(field) : false);
  }

  private boolean isCollection (String className, String fieldName)
  {
    Model model = getModel();

    return model.isCollection(model.getFieldType(className, fieldName));
  }
View Full Code Here

     * <code>pcClass</code>.
     * @param pcClass The persistence capable class.
     * @return A new instance of ClassDesc.
     */
    static ClassDesc newInstance(Class pcClass) {
        Model model = Model.RUNTIME;
        String className = pcClass.getName();
        ClassLoader classLoader = pcClass.getClassLoader();
        ClassDesc rc = null;

        try {
            MappingClassElement mdConfig =
               model.getMappingClass(className, classLoader);

            // Validate the model information for this class.
            validateModel(model, className, classLoader);

            rc = new ClassDesc(mdConfig, pcClass);
View Full Code Here

            }
        }

        // Notify others to cleanup
        TypeTable.removeInstance(classLoader);
        Model model = Model.RUNTIME;
        model.removeResourcesFromCaches(classLoader);

    }
View Full Code Here

TOP

Related Classes of com.sun.jdo.api.persistence.model.Model

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.