
com.sun.jdo.api.persistence.enhancer.meta.JDOMetaData Maven / Gradle / Ivy
/*
* Copyright (c) 1997, 2018 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* This Source Code may also be made available under the following Secondary
* Licenses when the conditions for such availability set forth in the
* Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
* version 2 with the GNU Classpath Exception, which is available at
* https://www.gnu.org/software/classpath/license.html.
*
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
*/
package com.sun.jdo.api.persistence.enhancer.meta;
/**
* Provides the JDO meta information neccessary for byte-code enhancement.
*
* Please note: This interface deals with fully qualified names in the
* JVM notation, that is, with '/' as package separator character (instead
* of '.').
*
* The following convention is used to specify the format of a given name:
* Something called ...
*
* -
* name represents a non-qualified name (e.g.
JDOPersistenceCapableName
* = "PersistenceCapable
")
* -
* type represents a Java-qualified class name (e.g.
JDOPersistenceCapablePath
* = 'com.sun.jdo.spi.persistence.support.sqlstore.PersistenceCapable
")
* -
* path represents a JVM-qualified name (e.g.
JDOPersistenceCapablePath
* = 'com/sun/jdo/spi/persistence/support/sqlstore/PersistenceCapable
")
* -
* sig (for signature) represents a JVM-qualified type-signature
* name (e.g.
JDOPersistenceCapableSig
* = "Lcom/sun/jdo/spi/persistence/support/sqlstore/PersistenceCapable;
")
*
*/
//@olsen: new interface
public interface JDOMetaData {
String JDOExternalPath = "com/sun/jdo/api/persistence/support/";// NOI18N
String JDOPath = "com/sun/jdo/spi/persistence/support/sqlstore/";// NOI18N
String JDOPersistenceCapableName = "PersistenceCapable";// NOI18N
String JDOPersistenceCapablePath = JDOPath + JDOPersistenceCapableName;// NOI18N
String JDOPersistenceCapableSig = "L" + JDOPersistenceCapablePath + ";";// NOI18N
String JDOPersistenceCapableType = JDOPersistenceCapablePath.replace('/', '.');
String javaLangCloneablePath = "java/lang/Cloneable";
String JDOInstanceCallbacksName = "InstanceCallbacks";// NOI18N
String JDOInstanceCallbacksPath = JDOPath + JDOInstanceCallbacksName;// NOI18N
String JDOInstanceCallbacksSig = "L" + JDOInstanceCallbacksPath + ";";// NOI18N
String JDOInstanceCallbacksType = JDOInstanceCallbacksPath.replace('/', '.');
String JDOSecondClassObjectBaseName = "SCO";// NOI18N
String JDOSecondClassObjectBasePath = JDOPath + JDOSecondClassObjectBaseName;// NOI18N
String JDOSecondClassObjectBaseSig = "L" + JDOSecondClassObjectBasePath + ";";// NOI18N
String JDOSecondClassObjectBaseType = JDOSecondClassObjectBasePath.replace('/', '.');
String JDOPersistenceManagerName = "PersistenceManager";// NOI18N
// we use the external, "public" PersistenceManager interface only
String JDOPersistenceManagerPath = JDOExternalPath + JDOPersistenceManagerName;// NOI18N
String JDOPersistenceManagerSig = "L" + JDOPersistenceManagerPath + ";";// NOI18N
String JDOPersistenceManagerType = JDOPersistenceManagerPath.replace('/', '.');
String JDOStateManagerName = "StateManager";// NOI18N
String JDOStateManagerPath = JDOPath + JDOStateManagerName;// NOI18N
String JDOStateManagerSig = "L" + JDOStateManagerPath + ";";// NOI18N
String JDOStateManagerType = JDOStateManagerPath.replace('/', '.');
String JDOStateManagerFieldName = "jdoStateManager";//NOI18N
String JDOStateManagerFieldType = JDOStateManagerType;
String JDOStateManagerFieldSig = JDOStateManagerSig;
String JDOFlagsFieldName = "jdoFlags";//NOI18N
String JDOFlagsFieldType = "byte";//NOI18N
String JDOFlagsFieldSig = "B";//NOI18N
/**
* Tests whether a class is known to be transient.
*
* The following invariant holds:
* isTransientClass(classPath)
* => !isPersistenceCapableClass(classPath)
* @param classPath the JVM-qualified name of the class
* @return true if this class is known to be transient; otherwise false
*/
boolean isTransientClass(String classPath)
throws JDOMetaDataUserException, JDOMetaDataFatalError;
/**
* Tests whether a class is known to be persistence-capable.
*
* The following invariant holds:
* isPersistenceCapableClass(classPath)
* => !isTransientClass(classPath)
* && !isSecondClassObjectType(classPath)
* @param classPath the JVM-qualified name of the class
* @return true if this class is persistence-capable; otherwise false
*/
boolean isPersistenceCapableClass(String classPath)
throws JDOMetaDataUserException, JDOMetaDataFatalError;
/**
* Tests whether a class is known as a persistence-capable root class.
*
* @param classPath the JVM-qualified name of the class
* @return true if this class is persistence-capable and does not
* derive from another persistence-capable class; otherwise false
*/
boolean isPersistenceCapableRootClass(String classPath)
throws JDOMetaDataUserException, JDOMetaDataFatalError;
/**
* Returns the name of the persistence-capable root class of a class.
*
* @param classPath the JVM-qualified name of the class
* @return the name of the least-derived persistence-capable class that
* is equal to or a super class of the argument class; if the
* argument class is not persistence-capable, null is returned.
*/
String getPersistenceCapableRootClass(String classPath)
throws JDOMetaDataUserException, JDOMetaDataFatalError;
/**
* Returns the name of the superclass of a class.
*
* @param classPath the JVM-qualified name of the class
* @return the name of the superclass.
*/
String getSuperClass(String classPath)
throws JDOMetaDataUserException, JDOMetaDataFatalError;
/**
* Tests whether a class is known as type for Second Class Objects.
*
* The following invariant holds:
* isSecondClassObjectType(classPath)
* => !isPersistenceCapableClass(classPath)
* @param classPath the JVM-qualified name of the type
* @return true if this type is known for second class objects;
* otherwise false
*/
boolean isSecondClassObjectType(String classPath)
throws JDOMetaDataUserException, JDOMetaDataFatalError;
/**
* Tests whether a class is known as type for Mutable Second Class Objects.
*
* @param classPath the JVM-qualified name of the type
* @return true if this type is known for mutable second class objects;
* otherwise false
*/
boolean isMutableSecondClassObjectType(String classPath)
throws JDOMetaDataUserException, JDOMetaDataFatalError;
/**
* Tests whether a field of a class is known to be persistent.
*
* @param classPath the JVM-qualified name of the class
* @param fieldName the name of the field
* @return true if this field is known to be persistent; otherwise false
*/
boolean isPersistentField(String classPath, String fieldName)
throws JDOMetaDataUserException, JDOMetaDataFatalError;
/**
* Tests whether a field of a class is known to be transactional.
*
* @param classPath the JVM-qualified name of the class
* @param fieldName the name of the field
* @return true if this field is known to be transactional; otherwise false
*/
boolean isTransactionalField(String classPath, String fieldName)
throws JDOMetaDataUserException, JDOMetaDataFatalError;
/**
* Tests whether a field of a class is known to be Primary Key.
*
* @param classPath the JVM-qualified name of the class
* @param fieldName the name of the field
* @return true if this field is known to be primary key; otherwise false
*/
boolean isPrimaryKeyField(String classPath, String fieldName)
throws JDOMetaDataUserException, JDOMetaDataFatalError;
/**
* Tests whether a field of a class is known to be part of the
* Default Fetch Group.
*
* @param classPath the JVM-qualified name of the class
* @param fieldName the name of the field
* @return true if this field is known to be part of the
* default fetch group; otherwise false
*/
boolean isDefaultFetchGroupField(String classPath, String fieldName)
throws JDOMetaDataUserException, JDOMetaDataFatalError;
/**
* Returns the unique field index of a declared, persistent field of a
* class.
*
* @param classPath the JVM-qualified name of the class
* @param fieldName the name of the field
* @return the non-negative, unique field index
*/
int getFieldNo(String classPath, String fieldName)
throws JDOMetaDataUserException, JDOMetaDataFatalError;
/**
* Returns an array of field names of all declared persistent and
* transactional fields of a class.
*
* The position of the field names in the result array corresponds
* to their unique field index as returned by getFieldNo such that
* these equations holds:
*
getFieldNo(getManagedFields(classPath)[i]) == i
*
getManagedFields(classPath)[getFieldNo(fieldName)] == fieldName
*
* @param classPath the JVM-qualified name of the class
* @return an array of all declared persistent and transactional
* fields of a class
*/
String[] getManagedFields(String classPath)
throws JDOMetaDataUserException, JDOMetaDataFatalError;
}