/src/com/google/appengine/datanucleus/annotations/UnownedHandler.java
Java | 32 lines | 11 code | 2 blank | 19 comment | 0 complexity | 64f919ac4bd98b256542c3f18c301e0f MD5 | raw file
1/* 2 * Copyright (C) 2011 Google Inc 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16package com.google.appengine.datanucleus.annotations; 17 18import org.datanucleus.ClassLoaderResolver; 19import org.datanucleus.metadata.AbstractMemberMetaData; 20import org.datanucleus.metadata.annotations.AnnotationObject; 21import org.datanucleus.metadata.annotations.MemberAnnotationHandler; 22 23/** 24 * Handler for the {@link Unowned} annotation when applied to a field/property of a persistable class. 25 * Adds the metadata extension "gae.unowned" as "true" for the member in question. 26 */ 27public class UnownedHandler implements MemberAnnotationHandler 28{ 29 public void processMemberAnnotation(AnnotationObject ann, AbstractMemberMetaData mmd, ClassLoaderResolver clr) { 30 mmd.addExtension("gae.unowned", "true"); 31 } 32}