openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ppod...@apache.org
Subject svn commit: r428883 - in /incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence: AnnotationPersistenceMetaDataParser.java LoadFetchGroup.java MetaDataTag.java
Date Fri, 04 Aug 2006 21:12:36 GMT
Author: ppoddar
Date: Fri Aug  4 14:12:35 2006
New Revision: 428883

URL: http://svn.apache.org/viewvc?rev=428883&view=rev
Log:
load-fetch-group annotation added

Added:
    incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/LoadFetchGroup.java
Modified:
    incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/AnnotationPersistenceMetaDataParser.java
    incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/MetaDataTag.java

Modified: incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/AnnotationPersistenceMetaDataParser.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/AnnotationPersistenceMetaDataParser.java?rev=428883&r1=428882&r2=428883&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/AnnotationPersistenceMetaDataParser.java
(original)
+++ incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/AnnotationPersistenceMetaDataParser.java
Fri Aug  4 14:12:35 2006
@@ -160,6 +160,7 @@
         _tags.put(Factory.class, FACTORY);
         _tags.put(FetchGroup.class, FETCH_GROUP);
         _tags.put(FetchGroups.class, FETCH_GROUPS);
+        _tags.put(LoadFetchGroup.class, LOAD_FETCH_GROUP);
         _tags.put(InverseLogical.class, INVERSE_LOGICAL);
         _tags.put(KeyDependent.class, KEY_DEPENDENT);
         _tags.put(KeyType.class, KEY_TYPE);
@@ -1042,6 +1043,10 @@
                         fmd.setTypeOverride(toOverrideType(((Type) anno).
                             value()));
                     break;
+                case LOAD_FETCH_GROUP:
+                	if (isMetaDataMode())
+                		fmd.setLoadFetchGroup(((LoadFetchGroup)anno).value());
+                	break;
                 default:
                     throw new UnsupportedException(_loc.get("unsupported", fmd,
                         anno.toString()));

Added: incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/LoadFetchGroup.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/LoadFetchGroup.java?rev=428883&view=auto
==============================================================================
--- incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/LoadFetchGroup.java
(added)
+++ incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/LoadFetchGroup.java
Fri Aug  4 14:12:35 2006
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.openjpa.persistence;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+/**
+ * Fetch group loaded when the annotated field/property is loaded. 
+ *
+ * @author Pinaki Poddar
+ * @since 4.0
+ */
+@Target({ METHOD, FIELD })
+@Retention(RUNTIME)
+public @interface LoadFetchGroup {
+
+    String value();
+}

Modified: incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/MetaDataTag.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/MetaDataTag.java?rev=428883&r1=428882&r2=428883&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/MetaDataTag.java
(original)
+++ incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/MetaDataTag.java
Fri Aug  4 14:12:35 2006
@@ -67,6 +67,7 @@
     FACTORY,
     FETCH_GROUP,
     FETCH_GROUPS,
+    LOAD_FETCH_GROUP,
     INVERSE_LOGICAL,
     KEY_DEPENDENT,
     KEY_TYPE,



Mime
View raw message