incubator-graffito-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apope...@apache.org
Subject svn commit: r376039 - in /incubator/graffito/trunk/jcr/jcr-mapping/src: java/org/apache/portals/graffito/jcr/persistence/objectconverter/ java/org/apache/portals/graffito/jcr/persistence/objectconverter/impl/ test/org/apache/portals/graffito/jcr/persis...
Date Wed, 08 Feb 2006 20:05:04 GMT
Author: apopescu
Date: Wed Feb  8 12:05:01 2006
New Revision: 376039

URL: http://svn.apache.org/viewcvs?rev=376039&view=rev
Log:
refined BeanConverter interface

Modified:
    incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/objectconverter/BeanConverter.java
    incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/objectconverter/impl/ObjectConverterImpl.java
    incubator/graffito/trunk/jcr/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/objectconverter/impl/BeanDescriptorTest.java

Modified: incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/objectconverter/BeanConverter.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/objectconverter/BeanConverter.java?rev=376039&r1=376038&r2=376039&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/objectconverter/BeanConverter.java
(original)
+++ incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/objectconverter/BeanConverter.java
Wed Feb  8 12:05:01 2006
@@ -23,6 +23,7 @@
 import org.apache.portals.graffito.jcr.exception.PersistenceException;
 import org.apache.portals.graffito.jcr.exception.RepositoryException;
 import org.apache.portals.graffito.jcr.mapper.Mapper;
+import org.apache.portals.graffito.jcr.mapper.model.BeanDescriptor;
 
 /**
  * Interface describing a custom bean converter. 
@@ -46,7 +47,7 @@
      *  wrapped in PersistenceException; marks a repository failure
      * @throws JcrMappingException throws in case the mapping of the bean is not correct
      */
-    void insert(Session session, Node parentNode, Mapper mapper, String beanName, Object
object)
+    void insert(Session session, Node parentNode, BeanDescriptor descriptor, Object object)
     throws PersistenceException, RepositoryException, JcrMappingException;
 
     /**
@@ -65,7 +66,7 @@
      *  wrapped in PersistenceException; marks a repository failure
      * @throws JcrMappingException throws in case the mapping of the bean is not correct
      */
-    void update(Session session, Node parentNode, Mapper mapper, String beanName, Object
object)
+    void update(Session session, Node parentNode, BeanDescriptor descriptor, Object object)
     throws PersistenceException, RepositoryException, JcrMappingException;
     
     /**
@@ -84,7 +85,7 @@
      *  wrapped in PersistenceException; marks a repository failure
      * @throws JcrMappingException throws in case the mapping of the bean is not correct
      */
-    Object getObject(Session session, Node parentNode, Mapper mapper, String beanName, Class
beanClass) 
+    Object getObject(Session session, Node parentNode, BeanDescriptor descriptor, Class beanClass)

     throws PersistenceException, RepositoryException, JcrMappingException;
 
 
@@ -103,6 +104,6 @@
      *  wrapped in PersistenceException; marks a repository failure
      * @throws JcrMappingException throws in case the mapping of the bean is not correct
      */
-    void remove(Session session, Node parentNode, Mapper mapper, String beanName)
+    void remove(Session session, Node parentNode, BeanDescriptor descriptor)
     throws PersistenceException, RepositoryException, JcrMappingException;
 }

Modified: incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/objectconverter/impl/ObjectConverterImpl.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/objectconverter/impl/ObjectConverterImpl.java?rev=376039&r1=376038&r2=376039&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/objectconverter/impl/ObjectConverterImpl.java
(original)
+++ incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/objectconverter/impl/ObjectConverterImpl.java
Wed Feb  8 12:05:01 2006
@@ -334,8 +334,7 @@
             else if (null != beanDescriptor.getBeanConverter()) {
                 bean = beanDescriptor.getBeanConverter().getObject(session,
                         node,
-                        this.mapper,
-                        beanName,
+                        beanDescriptor,
                         beanClass);
             }
             else {
@@ -392,8 +391,7 @@
                 else if (null != beanDescriptor.getBeanConverter()) {
                     beanDescriptor.getBeanConverter().insert(session,
                             objectNode,
-                            this.mapper,
-                            jcrName,
+                            beanDescriptor,
                             object);
                 }
                 else {
@@ -426,7 +424,7 @@
                         this.storeSimpleFields(session, bean, getClassDescriptor(beanClass),
objectNode);
                     }
                     else if (null != beanDescriptor.getBeanConverter()) {
-                        beanDescriptor.getBeanConverter().remove(session, objectNode, this.mapper,
jcrName);
+                        beanDescriptor.getBeanConverter().remove(session, objectNode, beanDescriptor);
                     }
                     else {
                         if (objectNode.hasNode(jcrName)) {
@@ -441,8 +439,7 @@
                     else if (null != beanDescriptor.getBeanConverter()) {
                         beanDescriptor.getBeanConverter().update(session,
                                 objectNode,
-                                this.mapper, 
-                                jcrName,
+                                beanDescriptor,
                                 bean);
                     }
                     else {

Modified: incubator/graffito/trunk/jcr/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/objectconverter/impl/BeanDescriptorTest.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/objectconverter/impl/BeanDescriptorTest.java?rev=376039&r1=376038&r2=376039&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/objectconverter/impl/BeanDescriptorTest.java
(original)
+++ incubator/graffito/trunk/jcr/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/objectconverter/impl/BeanDescriptorTest.java
Wed Feb  8 12:05:01 2006
@@ -219,7 +219,7 @@
         /**
          * @see org.apache.portals.graffito.jcr.persistence.objectconverter.BeanConverter#insert(javax.jcr.Session,
javax.jcr.Node, org.apache.portals.graffito.jcr.mapper.Mapper, java.lang.String, java.lang.Object)
          */
-        public void insert(Session session, Node parentNode, Mapper mapper, String beanName,
Object object) throws PersistenceException {
+        public void insert(Session session, Node parentNode, BeanDescriptor descriptor, Object
object) throws PersistenceException {
             try {
                 log.add("insert at path " + parentNode.getPath());
             }
@@ -231,7 +231,7 @@
         /**
          * @see org.apache.portals.graffito.jcr.persistence.objectconverter.BeanConverter#update(javax.jcr.Session,
javax.jcr.Node, org.apache.portals.graffito.jcr.mapper.Mapper, java.lang.String, java.lang.Object)
          */
-        public void update(Session session, Node parentNode, Mapper mapper, String beanName,
Object object) throws PersistenceException {
+        public void update(Session session, Node parentNode, BeanDescriptor descriptor, Object
object) throws PersistenceException {
             try {
                 log.add("update at path " + parentNode.getPath());
             }
@@ -243,7 +243,7 @@
         /**
          * @see org.apache.portals.graffito.jcr.persistence.objectconverter.BeanConverter#getObject(javax.jcr.Session,
javax.jcr.Node, org.apache.portals.graffito.jcr.mapper.Mapper, java.lang.String, java.lang.Class)
          */
-        public Object getObject(Session session, Node parentNode, Mapper mapper, String beanName,
Class beanClass) throws PersistenceException {
+        public Object getObject(Session session, Node parentNode, BeanDescriptor descriptor,
Class beanClass) throws PersistenceException {
             try {
                 log.add("get from path " + parentNode.getPath());
             }
@@ -256,7 +256,7 @@
         /**
          * @see org.apache.portals.graffito.jcr.persistence.objectconverter.BeanConverter#remove(javax.jcr.Session,
javax.jcr.Node, org.apache.portals.graffito.jcr.mapper.Mapper, java.lang.String)
          */
-        public void remove(Session session, Node parentNode, Mapper mapper, String beanName)
throws PersistenceException {
+        public void remove(Session session, Node parentNode, BeanDescriptor descriptor) throws
PersistenceException {
             try {
                 log.add("remove from path " + parentNode.getPath());
             }



Mime
View raw message