cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r1068901 - /cayenne/main/trunk/framework/cayenne-lifecycle/src/main/java/org/apache/cayenne/lifecycle/relationship/
Date Wed, 09 Feb 2011 14:20:01 GMT
Author: aadamchik
Date: Wed Feb  9 14:20:00 2011
New Revision: 1068901

URL: http://svn.apache.org/viewvc?rev=1068901&view=rev
Log:
CAY-1532 Import cayenne-lifecycle from sandbox

renaming MixinRelationship to UuidRelationship - getting rid of the 'mixin' term

Added:
    cayenne/main/trunk/framework/cayenne-lifecycle/src/main/java/org/apache/cayenne/lifecycle/relationship/UuidRelationship.java
      - copied, changed from r1065704, cayenne/main/trunk/framework/cayenne-lifecycle/src/main/java/org/apache/cayenne/lifecycle/relationship/MixinRelationship.java
    cayenne/main/trunk/framework/cayenne-lifecycle/src/main/java/org/apache/cayenne/lifecycle/relationship/UuidRelationshipBatchFaultingStrategy.java
      - copied, changed from r1065704, cayenne/main/trunk/framework/cayenne-lifecycle/src/main/java/org/apache/cayenne/lifecycle/relationship/MixinRelationshipBatchFaultingStrategy.java
    cayenne/main/trunk/framework/cayenne-lifecycle/src/main/java/org/apache/cayenne/lifecycle/relationship/UuidRelationshipFaultingStrategy.java
      - copied, changed from r1065704, cayenne/main/trunk/framework/cayenne-lifecycle/src/main/java/org/apache/cayenne/lifecycle/relationship/MixinRelationshipFaultingStrategy.java
    cayenne/main/trunk/framework/cayenne-lifecycle/src/main/java/org/apache/cayenne/lifecycle/relationship/UuidRelationshipFilter.java
      - copied, changed from r1065704, cayenne/main/trunk/framework/cayenne-lifecycle/src/main/java/org/apache/cayenne/lifecycle/relationship/MixinRelationshipFilter.java
Removed:
    cayenne/main/trunk/framework/cayenne-lifecycle/src/main/java/org/apache/cayenne/lifecycle/relationship/MixinRelationship.java
    cayenne/main/trunk/framework/cayenne-lifecycle/src/main/java/org/apache/cayenne/lifecycle/relationship/MixinRelationshipBatchFaultingStrategy.java
    cayenne/main/trunk/framework/cayenne-lifecycle/src/main/java/org/apache/cayenne/lifecycle/relationship/MixinRelationshipFaultingStrategy.java
    cayenne/main/trunk/framework/cayenne-lifecycle/src/main/java/org/apache/cayenne/lifecycle/relationship/MixinRelationshipFilter.java

Copied: cayenne/main/trunk/framework/cayenne-lifecycle/src/main/java/org/apache/cayenne/lifecycle/relationship/UuidRelationship.java
(from r1065704, cayenne/main/trunk/framework/cayenne-lifecycle/src/main/java/org/apache/cayenne/lifecycle/relationship/MixinRelationship.java)
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-lifecycle/src/main/java/org/apache/cayenne/lifecycle/relationship/UuidRelationship.java?p2=cayenne/main/trunk/framework/cayenne-lifecycle/src/main/java/org/apache/cayenne/lifecycle/relationship/UuidRelationship.java&p1=cayenne/main/trunk/framework/cayenne-lifecycle/src/main/java/org/apache/cayenne/lifecycle/relationship/MixinRelationship.java&r1=1065704&r2=1068901&rev=1068901&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-lifecycle/src/main/java/org/apache/cayenne/lifecycle/relationship/MixinRelationship.java
(original)
+++ cayenne/main/trunk/framework/cayenne-lifecycle/src/main/java/org/apache/cayenne/lifecycle/relationship/UuidRelationship.java
Wed Feb  9 14:20:00 2011
@@ -26,10 +26,8 @@ import java.lang.annotation.RetentionPol
 import java.lang.annotation.Target;
 
 /**
- * Allows to tag a relationship from a mixin entity to another entity that has this mixin
- * attached. When a mixin is modeled via its own set of entities, this annotation is
- * placed on a "mixin" entity class, telling Cayenne to inject related entity object in a
- * mixin entity, resolved based on the object UUID "FK".
+ * Defines a "virtual" read-only to-one relationship based on an FK that is a UUID. This
+ * way a related object can be of any entity type.
  * 
  * @since 3.1
  */
@@ -39,11 +37,11 @@ import java.lang.annotation.Target;
 @Retention(RetentionPolicy.RUNTIME)
 @Documented
 @Inherited
-public @interface MixinRelationship {
+public @interface UuidRelationship {
 
     /**
-     * Returns the name of the property of the mixin entity that is a UUID "FK" to any of
-     * the entities implementing the mixin.
+     * Returns the name of the property of the source entity of the relationship that
+     * stores a UUID "FK" of a related entity.
      */
     String value() default "";
 }

Copied: cayenne/main/trunk/framework/cayenne-lifecycle/src/main/java/org/apache/cayenne/lifecycle/relationship/UuidRelationshipBatchFaultingStrategy.java
(from r1065704, cayenne/main/trunk/framework/cayenne-lifecycle/src/main/java/org/apache/cayenne/lifecycle/relationship/MixinRelationshipBatchFaultingStrategy.java)
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-lifecycle/src/main/java/org/apache/cayenne/lifecycle/relationship/UuidRelationshipBatchFaultingStrategy.java?p2=cayenne/main/trunk/framework/cayenne-lifecycle/src/main/java/org/apache/cayenne/lifecycle/relationship/UuidRelationshipBatchFaultingStrategy.java&p1=cayenne/main/trunk/framework/cayenne-lifecycle/src/main/java/org/apache/cayenne/lifecycle/relationship/MixinRelationshipBatchFaultingStrategy.java&r1=1065704&r2=1068901&rev=1068901&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-lifecycle/src/main/java/org/apache/cayenne/lifecycle/relationship/MixinRelationshipBatchFaultingStrategy.java
(original)
+++ cayenne/main/trunk/framework/cayenne-lifecycle/src/main/java/org/apache/cayenne/lifecycle/relationship/UuidRelationshipBatchFaultingStrategy.java
Wed Feb  9 14:20:00 2011
@@ -21,14 +21,17 @@ package org.apache.cayenne.lifecycle.rel
 import org.apache.cayenne.DataObject;
 
 /**
+ * A faulting strategy that does batch-faulting of related objects whenever a first UUID
+ * relationship is accessed.
+ * 
  * @since 3.1
  */
-public class MixinRelationshipBatchFaultingStrategy implements
-        MixinRelationshipFaultingStrategy {
+public class UuidRelationshipBatchFaultingStrategy implements
+        UuidRelationshipFaultingStrategy {
 
     private ThreadLocal<UuidBatchFault> batchFaultHolder;
 
-    public MixinRelationshipBatchFaultingStrategy() {
+    public UuidRelationshipBatchFaultingStrategy() {
         this.batchFaultHolder = new ThreadLocal<UuidBatchFault>();
     }
 
@@ -65,8 +68,8 @@ public class MixinRelationshipBatchFault
 
     String uuidPropertyName(DataObject object) {
 
-        MixinRelationship annotation = object.getClass().getAnnotation(
-                MixinRelationship.class);
+        UuidRelationship annotation = object.getClass().getAnnotation(
+                UuidRelationship.class);
 
         // TODO: look it up in the superclasses??
         if (annotation == null) {

Copied: cayenne/main/trunk/framework/cayenne-lifecycle/src/main/java/org/apache/cayenne/lifecycle/relationship/UuidRelationshipFaultingStrategy.java
(from r1065704, cayenne/main/trunk/framework/cayenne-lifecycle/src/main/java/org/apache/cayenne/lifecycle/relationship/MixinRelationshipFaultingStrategy.java)
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-lifecycle/src/main/java/org/apache/cayenne/lifecycle/relationship/UuidRelationshipFaultingStrategy.java?p2=cayenne/main/trunk/framework/cayenne-lifecycle/src/main/java/org/apache/cayenne/lifecycle/relationship/UuidRelationshipFaultingStrategy.java&p1=cayenne/main/trunk/framework/cayenne-lifecycle/src/main/java/org/apache/cayenne/lifecycle/relationship/MixinRelationshipFaultingStrategy.java&r1=1065704&r2=1068901&rev=1068901&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-lifecycle/src/main/java/org/apache/cayenne/lifecycle/relationship/MixinRelationshipFaultingStrategy.java
(original)
+++ cayenne/main/trunk/framework/cayenne-lifecycle/src/main/java/org/apache/cayenne/lifecycle/relationship/UuidRelationshipFaultingStrategy.java
Wed Feb  9 14:20:00 2011
@@ -21,11 +21,11 @@ package org.apache.cayenne.lifecycle.rel
 import org.apache.cayenne.DataObject;
 
 /**
- * An abstract strategy for resolving mixin relationships.
+ * An abstract strategy for resolving UUID relationships.
  * 
  * @since 3.1
  */
-public interface MixinRelationshipFaultingStrategy {
+public interface UuidRelationshipFaultingStrategy {
 
     void afterObjectLoaded(DataObject object);
 

Copied: cayenne/main/trunk/framework/cayenne-lifecycle/src/main/java/org/apache/cayenne/lifecycle/relationship/UuidRelationshipFilter.java
(from r1065704, cayenne/main/trunk/framework/cayenne-lifecycle/src/main/java/org/apache/cayenne/lifecycle/relationship/MixinRelationshipFilter.java)
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-lifecycle/src/main/java/org/apache/cayenne/lifecycle/relationship/UuidRelationshipFilter.java?p2=cayenne/main/trunk/framework/cayenne-lifecycle/src/main/java/org/apache/cayenne/lifecycle/relationship/UuidRelationshipFilter.java&p1=cayenne/main/trunk/framework/cayenne-lifecycle/src/main/java/org/apache/cayenne/lifecycle/relationship/MixinRelationshipFilter.java&r1=1065704&r2=1068901&rev=1068901&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-lifecycle/src/main/java/org/apache/cayenne/lifecycle/relationship/MixinRelationshipFilter.java
(original)
+++ cayenne/main/trunk/framework/cayenne-lifecycle/src/main/java/org/apache/cayenne/lifecycle/relationship/UuidRelationshipFilter.java
Wed Feb  9 14:20:00 2011
@@ -30,20 +30,20 @@ import org.apache.cayenne.graph.GraphDif
 import org.apache.cayenne.query.Query;
 
 /**
- * A {@link DataChannelFilter} that implements mixin relationships faulting functionality.
+ * A {@link DataChannelFilter} that implements UUID relationships read functionality.
  * 
  * @since 3.1
  */
-public class MixinRelationshipFilter implements DataChannelFilter {
+public class UuidRelationshipFilter implements DataChannelFilter {
 
-    private MixinRelationshipFaultingStrategy faultingStrategy;
+    private UuidRelationshipFaultingStrategy faultingStrategy;
 
     public void init(DataChannel channel) {
         this.faultingStrategy = createFaultingStrategy();
     }
 
-    protected MixinRelationshipFaultingStrategy createFaultingStrategy() {
-        return new MixinRelationshipBatchFaultingStrategy();
+    protected UuidRelationshipFaultingStrategy createFaultingStrategy() {
+        return new UuidRelationshipBatchFaultingStrategy();
     }
 
     public GraphDiff onSync(
@@ -72,8 +72,8 @@ public class MixinRelationshipFilter imp
      * A lifecycle callback method that delegates object post load event processing to the
      * underlying faulting strategy.
      */
-    @PostLoad(entityAnnotations = MixinRelationship.class)
-    @PostPersist(entityAnnotations = MixinRelationship.class)
+    @PostLoad(entityAnnotations = UuidRelationship.class)
+    @PostPersist(entityAnnotations = UuidRelationship.class)
     void postLoad(DataObject object) {
         faultingStrategy.afterObjectLoaded(object);
     }



Mime
View raw message