db-jdo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From an...@apache.org
Subject svn commit: r739369 - in /db/jdo/trunk/api2/src/java/javax/jdo/metadata: ClassMetadata.java ComponentMetadata.java JDOMetadata.java PackageMetadata.java
Date Fri, 30 Jan 2009 18:37:10 GMT
Author: andyj
Date: Fri Jan 30 18:37:10 2009
New Revision: 739369

URL: http://svn.apache.org/viewvc?rev=739369&view=rev
Log:
JDO-615 Convenience methods for typesafe generation of subobjects - package, class, interface,
field, property

Modified:
    db/jdo/trunk/api2/src/java/javax/jdo/metadata/ClassMetadata.java
    db/jdo/trunk/api2/src/java/javax/jdo/metadata/ComponentMetadata.java
    db/jdo/trunk/api2/src/java/javax/jdo/metadata/JDOMetadata.java
    db/jdo/trunk/api2/src/java/javax/jdo/metadata/PackageMetadata.java

Modified: db/jdo/trunk/api2/src/java/javax/jdo/metadata/ClassMetadata.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/src/java/javax/jdo/metadata/ClassMetadata.java?rev=739369&r1=739368&r2=739369&view=diff
==============================================================================
--- db/jdo/trunk/api2/src/java/javax/jdo/metadata/ClassMetadata.java (original)
+++ db/jdo/trunk/api2/src/java/javax/jdo/metadata/ClassMetadata.java Fri Jan 30 18:37:10 2009
@@ -16,6 +16,8 @@
  */
 package javax.jdo.metadata;
 
+import java.lang.reflect.Field;
+
 /**
  * Represents a class.
  * @since 2.3
@@ -39,4 +41,11 @@
      * @return The FieldMetadata
      */
     FieldMetadata newFieldMetadata(String name);
+
+    /**
+     * Add a new field to this class.
+     * @param name Name of the field
+     * @return The FieldMetadata
+     */
+    FieldMetadata newFieldMetadata(Field fld);
 }
\ No newline at end of file

Modified: db/jdo/trunk/api2/src/java/javax/jdo/metadata/ComponentMetadata.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/src/java/javax/jdo/metadata/ComponentMetadata.java?rev=739369&r1=739368&r2=739369&view=diff
==============================================================================
--- db/jdo/trunk/api2/src/java/javax/jdo/metadata/ComponentMetadata.java (original)
+++ db/jdo/trunk/api2/src/java/javax/jdo/metadata/ComponentMetadata.java Fri Jan 30 18:37:10
2009
@@ -16,6 +16,8 @@
  */
 package javax.jdo.metadata;
 
+import java.lang.reflect.Method;
+
 import javax.jdo.annotations.IdentityType;
 
 /**
@@ -319,6 +321,14 @@
     PropertyMetadata newPropertyMetadata(String name);
 
     /**
+     * Add a new property for this component.
+     * 
+     * @param method Java bean getter/setter method
+     * @return The PropertyMetadata
+     */
+    PropertyMetadata newPropertyMetadata(Method method);
+
+    /**
      * Accessor for all named queries defined on the component.
      * 
      * @return The queries

Modified: db/jdo/trunk/api2/src/java/javax/jdo/metadata/JDOMetadata.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/src/java/javax/jdo/metadata/JDOMetadata.java?rev=739369&r1=739368&r2=739369&view=diff
==============================================================================
--- db/jdo/trunk/api2/src/java/javax/jdo/metadata/JDOMetadata.java (original)
+++ db/jdo/trunk/api2/src/java/javax/jdo/metadata/JDOMetadata.java Fri Jan 30 18:37:10 2009
@@ -68,6 +68,14 @@
     PackageMetadata newPackageMetadata(String pkgName);
 
     /**
+     * Add a new package to this JDO Metadata.
+     * 
+     * @param pkg The package
+     * @return The PackageMetadata
+     */
+    PackageMetadata newPackageMetadata(Package pkg);
+
+    /**
      * Accessor for the number of packages defined in this JDO Metadata.
      * 
      * @return The number of packages.
@@ -75,6 +83,24 @@
     int getNumberOfPackages();
 
     /**
+     * Add a new class to this JDO Metadata.
+     * Adds its package also if not yet existing.
+     * 
+     * @param cls Class to add
+     * @return The ClassMetadata
+     */
+    ClassMetadata newClassMetadata(Class cls);
+
+    /**
+     * Add a new interface to this JDO Metadata.
+     * Adds its package also if not yet existing.
+     * 
+     * @param cls Class to add
+     * @return The InterfaceMetadata
+     */
+    InterfaceMetadata newInterfaceMetadata(Class cls);
+
+    /**
      * Accessor for any named queries defined on the JDO Metadata.
      * 
      * @return The queries

Modified: db/jdo/trunk/api2/src/java/javax/jdo/metadata/PackageMetadata.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/src/java/javax/jdo/metadata/PackageMetadata.java?rev=739369&r1=739368&r2=739369&view=diff
==============================================================================
--- db/jdo/trunk/api2/src/java/javax/jdo/metadata/PackageMetadata.java (original)
+++ db/jdo/trunk/api2/src/java/javax/jdo/metadata/PackageMetadata.java Fri Jan 30 18:37:10
2009
@@ -75,6 +75,14 @@
     ClassMetadata newClassMetadata(String name);
 
     /**
+     * Add a new class to this package.
+     * 
+     * @param cls The class
+     * @return The ClassMetadata
+     */
+    ClassMetadata newClassMetadata(Class cls);
+
+    /**
      * Accessor for the number of classes defined in this package.
      * 
      * @return The number of classes.
@@ -97,6 +105,14 @@
     InterfaceMetadata newInterfaceMetadata(String name);
 
     /**
+     * Add a new interface to this package.
+     * 
+     * @param cls The class
+     * @return The ClassMetadata
+     */
+    InterfaceMetadata newInterfaceMetadata(Class cls);
+
+    /**
      * Accessor for the number of interfaces defined in this package.
      * 
      * @return The number of interfaces.



Mime
View raw message