load-fetch-group annotation added

git-svn-id: https://svn.apache.org/repos/asf/incubator/openjpa/trunk@428883 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Pinaki Poddar 2006-08-04 21:12:35 +00:00
parent ca83f07b45
commit 1a2d048f3d
3 changed files with 41 additions and 0 deletions

View File

@ -160,6 +160,7 @@ public class AnnotationPersistenceMetaDataParser
_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 @@ public class AnnotationPersistenceMetaDataParser
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()));

View File

@ -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();
}

View File

@ -67,6 +67,7 @@ public enum MetaDataTag {
FACTORY,
FETCH_GROUP,
FETCH_GROUPS,
LOAD_FETCH_GROUP,
INVERSE_LOGICAL,
KEY_DEPENDENT,
KEY_TYPE,