Search in sources :

Example 1 with ClassMetadataImpl

use of org.datanucleus.api.jdo.metadata.ClassMetadataImpl in project datanucleus-api-jdo by datanucleus.

the class JDOPersistenceManagerFactory method getMetadata.

/**
 * Method to return the (class) metadata object for the specified class, if there is
 * metadata defined for that class.
 * @param className Name of the class that we want metadata for
 * @return The metadata
 */
public javax.jdo.metadata.TypeMetadata getMetadata(String className) {
    MetaDataManager mmgr = nucleusContext.getMetaDataManager();
    AbstractClassMetaData acmd = mmgr.getMetaDataForClass(className, nucleusContext.getClassLoaderResolver(null));
    if (acmd == null) {
        return null;
    }
    if (acmd instanceof ClassMetaData) {
        return new ClassMetadataImpl((ClassMetaData) acmd);
    }
    return new InterfaceMetadataImpl((InterfaceMetaData) acmd);
}
Also used : MetaDataManager(org.datanucleus.metadata.MetaDataManager) ClassMetadataImpl(org.datanucleus.api.jdo.metadata.ClassMetadataImpl) InterfaceMetadataImpl(org.datanucleus.api.jdo.metadata.InterfaceMetadataImpl) AbstractClassMetaData(org.datanucleus.metadata.AbstractClassMetaData) AbstractClassMetaData(org.datanucleus.metadata.AbstractClassMetaData) ClassMetaData(org.datanucleus.metadata.ClassMetaData)

Aggregations

ClassMetadataImpl (org.datanucleus.api.jdo.metadata.ClassMetadataImpl)1 InterfaceMetadataImpl (org.datanucleus.api.jdo.metadata.InterfaceMetadataImpl)1 AbstractClassMetaData (org.datanucleus.metadata.AbstractClassMetaData)1 ClassMetaData (org.datanucleus.metadata.ClassMetaData)1 MetaDataManager (org.datanucleus.metadata.MetaDataManager)1