use of org.datanucleus.api.jdo.metadata.JDOMetaDataManager in project tests by datanucleus.
the class BasicTest method testFieldColumnMetadata.
/**
* Tests the column field declared in many forms
*/
public void testFieldColumnMetadata() {
MetaDataManager mgr = new JDOMetaDataManager(new PersistenceNucleusContextImpl("JDO", null));
mgr.setValidate(false);
AbstractClassMetaData cmdD0 = mgr.getMetaDataForClass(D0.class, new ClassLoaderResolverImpl());
AbstractClassMetaData cmdD1 = mgr.getMetaDataForClass(D1.class, new ClassLoaderResolverImpl());
AbstractClassMetaData cmdD2 = mgr.getMetaDataForClass(D2.class, new ClassLoaderResolverImpl());
assertEquals("NNN", cmdD0.getMetaDataForManagedMemberAtAbsolutePosition(cmdD0.getAbsolutePositionOfMember("name")).getColumnMetaData()[0].getName());
assertEquals(cmdD0.getMetaDataForManagedMemberAtAbsolutePosition(cmdD0.getAbsolutePositionOfMember("name")).getColumnMetaData()[0].getName(), cmdD1.getMetaDataForManagedMemberAtAbsolutePosition(cmdD1.getAbsolutePositionOfMember("name")).getColumnMetaData()[0].getName());
assertEquals(cmdD0.getMetaDataForManagedMemberAtAbsolutePosition(cmdD0.getAbsolutePositionOfMember("name")).getColumnMetaData()[0].getName(), cmdD2.getMetaDataForManagedMemberAtAbsolutePosition(cmdD2.getAbsolutePositionOfMember("name")).getColumnMetaData()[0].getName());
}
use of org.datanucleus.api.jdo.metadata.JDOMetaDataManager in project tests by datanucleus.
the class BasicTest method testFieldDeclaredInSubClassMetadata.
/**
* Tests a field declared in the metadata of a subclass, like Subclass.field
*/
public void testFieldDeclaredInSubClassMetadata() {
MetaDataManager mgr = new JDOMetaDataManager(new PersistenceNucleusContextImpl("JDO", null));
mgr.setValidate(false);
AbstractClassMetaData cmdD0 = mgr.getMetaDataForClass(Pet.class, new ClassLoaderResolverImpl());
AbstractClassMetaData cmdD1 = mgr.getMetaDataForClass(Dog.class, new ClassLoaderResolverImpl());
AbstractClassMetaData cmdD2 = mgr.getMetaDataForClass(Cat.class, new ClassLoaderResolverImpl());
assertNotNull(cmdD0.getMetaDataForMember("name"));
assertNotNull(cmdD1.getMetaDataForMember("name"));
assertEquals("dog", cmdD1.getMetaDataForMember("name").getColumnMetaData()[0].getName());
assertNotNull(cmdD2.getMetaDataForMember("name"));
assertEquals("cat", cmdD2.getMetaDataForMember("name").getColumnMetaData()[0].getName());
}
use of org.datanucleus.api.jdo.metadata.JDOMetaDataManager in project tests by datanucleus.
the class AnnotationPlusXMLOverrideTest method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
nucleusCtx = new PersistenceNucleusContextImpl("JDO", null);
metaDataMgr = new JDOMetaDataManager(nucleusCtx);
clr = new ClassLoaderResolverImpl();
}
Aggregations