01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one
03: * or more contributor license agreements. See the NOTICE file
04: * distributed with this work for additional information
05: * regarding copyright ownership. The ASF licenses this file
06: * to you under the Apache License, Version 2.0 (the
07: * "License"); you may not use this file except in compliance
08: * with the License. You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing,
13: * software distributed under the License is distributed on an
14: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15: * KIND, either express or implied. See the License for the
16: * specific language governing permissions and limitations
17: * under the License.
18: */
19: package org.apache.openjpa.meta;
20:
21: import java.lang.reflect.Member;
22:
23: import org.apache.openjpa.event.CallbackModes;
24:
25: /**
26: * Populates new metadata with default values.
27: *
28: * @author Abe White
29: */
30: public interface MetaDataDefaults extends CallbackModes {
31:
32: /**
33: * Return the default access type for a base persistent class with
34: * {@link ClassMetaData#ACCESS_UNKNOWN} access type.
35: */
36: public int getDefaultAccessType();
37:
38: /**
39: * Return the default identity type for unmapped classes without primary
40: * key fields.
41: */
42: public int getDefaultIdentityType();
43:
44: /**
45: * What to do on lifecycle callback exceptions.
46: */
47: public int getCallbackMode();
48:
49: /**
50: * If callbacks are fired before listeners for the given
51: * event type. Defaults to false.
52: */
53: public boolean getCallbacksBeforeListeners(int type);
54:
55: /**
56: * Whether declared interfaces of a class are treated as persistent
57: * types. Defaults to true.
58: */
59: public boolean isDeclaredInterfacePersistent();
60:
61: /**
62: * Whether the field in the object id class corresponding to a
63: * datastore id persistence-capable primary key field is the simple
64: * datastore id value of the related instance. Defaults to false.
65: */
66: public boolean isDataStoreObjectIdFieldUnwrapped();
67:
68: /**
69: * Whether to ignore members which are not persistent by default
70: * during metadata population. Defaults to true.
71: */
72: public void setIgnoreNonPersistent(boolean ignore);
73:
74: /**
75: * Populate the given metadata with default settings.
76: *
77: * @param access access type constant from {@link ClassMetaData}
78: */
79: public void populate(ClassMetaData meta, int access);
80:
81: /**
82: * Return the backing member for the given field metadata.
83: */
84: public Member getBackingMember(FieldMetaData field);
85:
86: /**
87: * Return a runtime exception class to throw for un-implemented
88: * managed interface methods.
89: */
90: public Class getUnimplementedExceptionType();
91: }
|