/** * Compiles the parsed PDL into the specified MetadataRoot. * * @param root The MetadataRoot to emit to. */ public void emit(MetadataRoot root) { m_pdl.emit(root.getRoot()); m_pdl.emitVersioned(); if (root.equals(MetadataRoot.getMetadataRoot())) { MetadataRoot.loadPrimitives(); } }
/** Test method: void addFile(String) */ public void testStartupXML() { MetadataRoot root = SessionManager.getMetadataRoot(); if (root == null) { fail("Metadata root not loaded"); } // Make sure we have at least one schema or model if (!root.getModels().hasNext()) { fail( "Metadata root has no schema or model. Check that you have " + "correctly specified the file paths in the xmlFiles parameter " + "in the init script you are using."); } }
/** * This looks up the specified ObjectType within the SessionManager and returns the ObjectType * object that is specified by the string. * * @param typeName This is the name of the ObjectType to look up. * @pre typeName != null */ private static final ObjectType lookup(String typeName) { ObjectType type = MetadataRoot.getMetadataRoot().getObjectType(typeName); if (type == null) { throw new PersistenceException("No such type " + typeName); } return type; }
public static final ObjectType fromType( MetadataRoot root, com.redhat.persistence.metadata.ObjectType type) { return root.getObjectType(type.getQualifiedName()); }