001 // <editor-fold defaultstate="collapsed" desc=" License Header ">
002 /*
003 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
004 *
005 * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
006 *
007 * The contents of this file are subject to the terms of either the GNU
008 * General Public License Version 2 only ("GPL") or the Common
009 * Development and Distribution License("CDDL") (collectively, the
010 * "License"). You may not use this file except in compliance with the
011 * License. You can obtain a copy of the License at
012 * http://www.netbeans.org/cddl-gplv2.html
013 * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
014 * specific language governing permissions and limitations under the
015 * License. When distributing the software, include this License Header
016 * Notice in each file and include the License file at
017 * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
018 * particular file as subject to the "Classpath" exception as provided
019 * by Sun in the GPL Version 2 section of the License file that
020 * accompanied this code. If applicable, add the following below the
021 * License Header, with the fields enclosed by brackets [] replaced by
022 * your own identifying information:
023 * "Portions Copyrighted [year] [name of copyright owner]"
024 *
025 * Contributor(s):
026 *
027 * The Original Software is NetBeans. The Initial Developer of the Original
028 * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
029 * Microsystems, Inc. All Rights Reserved.
030 *
031 * If you wish your version of this file to be governed by only the CDDL
032 * or only the GPL Version 2, indicate your decision by adding
033 * "[Contributor] elects to include this software in this distribution
034 * under the [CDDL or GPL Version 2] license." If you do not indicate a
035 * single choice of license, a recipient has the option to distribute
036 * your version of this file under either the CDDL, the GPL Version 2 or
037 * to extend the choice of license to its licensees as provided above.
038 * However, if you add GPL Version 2 code and therefore, elected the GPL
039 * Version 2 license, then the option applies only if the new code is
040 * made subject to such option by the copyright holder.
041 */
042 // </editor-fold>
043 /*
044 * EJBInfoHelper.java
045 *
046 * Created on October 15, 2004, 12:51 PM
047 * NOTE: This is a copy of the file in glassfish which is copied
048 * here so as to make the classes available to the plugin for
049 * appservers pre 9.0/glassfish.
050 */
051
052 package com.sun.jdo.api.persistence.mapping.ejb;
053
054 import java.util.Collection;
055
056 import org.netbeans.modules.dbschema.SchemaElement;
057
058 import com.sun.jdo.api.persistence.model.Model;
059
060 /** This is an interface which represents information found in the
061 * ejb-jar.xml descriptor and provides a variety of other information
062 * and helper objects needed to do mapping and generating of ejb related
063 * things in persistence.
064 *
065 * @author Rochelle Raccah
066 */
067 public interface EJBInfoHelper {
068 /** Gets the name of the ejb jar.
069 * @return the name of the ejb jar
070 */
071 public String getEjbJarDisplayName();
072
073 /** Gets a collection of names of schemas defined in this
074 * ejb jar.
075 * @return a collection schema names
076 */
077 public Collection getAvailableSchemaNames();
078
079 /** Gets the name to use for schema generation. An example might be
080 * a combo of app name, module name, etc.
081 * @return the name to use for schema generation
082 */
083 public String getSchemaNameToGenerate();
084
085 /** Gets the schema with the specified name, loading it if necessary.
086 * @param schemaName the name of the schema to be loaded
087 * @return the schema object
088 */
089 public SchemaElement getSchema(String schemaName);
090
091 /** Gets a collection of names of cmp entity beans defined in this
092 * ejb jar.
093 * @return a collection cmp ejb names
094 */
095 public Collection getEjbNames();
096
097 /** Gets a collection of names of cmp fields and cmr fields defined in
098 * this ejb jar for the specified ejb.
099 * @param ejbName the name of the ejb for which a list of fields
100 * will be created
101 * @return a collection cmp and cmr field names
102 */
103 public Collection getFieldsForEjb(String ejbName);
104
105 /** Gets a collection of names of cmr fields defined in
106 * this ejb jar for the specified ejb.
107 * @param ejbName the name of the ejb for which a list of cmr fields
108 * will be created
109 * @return a collection cmr field names
110 */
111 public Collection getRelationshipsForEjb(String ejbName);
112
113 /** Gets the class loader which corresponds to this ejb jar.
114 * Implementations can return <code>null</code> if this is not
115 * relevant.
116 * @return the class loader which corresponds to this ejb jar
117 */
118 public ClassLoader getClassLoader();
119
120 /** Gets the AbstractNameMapper object to use for this helper.
121 * @return the name mapper object
122 */
123 public AbstractNameMapper getNameMapper();
124
125 /** Creates and returns an instance of the AbstractNameMapper object to
126 * use for generation of unique names with this helper. Unique names
127 * usually means that the mapper doesn't use the same jdo and ejb names.
128 * Note that this method is a factory-like method which creates a new
129 * instance so the caller can make modifications to it as necessary.
130 * @return the name mapper object
131 */
132 public AbstractNameMapper createUniqueNameMapper();
133
134 /** Creates and returns an instance of the ConversionHelper object to
135 * use for this helper. Note that this method is a factory-like method
136 * which creates a new instance so the caller can make modifications to
137 * it as necessary.
138 * @return the conversion helper object
139 */
140 public ConversionHelper createConversionHelper();
141
142 /** Gets the Model object to use for this helper.
143 * @return the model object
144 */
145 public Model getModel();
146 }
|