@Test @Sudo public void testDescribeAllTypes() { OSchema schema = tester.getMetadata().getSchema(); try { DAO.describe(OSchemaHelper.bind(tester.getDatabase()), IDAOAllTypesTestClass.class); assertTrue(schema.existsClass("DAOAllTypesTestClass")); assertTrue(schema.existsClass("IDAODummyClass")); OClass oClass = schema.getClass("DAOAllTypesTestClass"); OClass dummyClass = schema.getClass("IDAODummyClass"); assertTrue(!oClass.isAbstract()); assertProperty(oClass, "boolean", OType.BOOLEAN, false); assertProperty(oClass, "booleanPrimitive", OType.BOOLEAN, true); assertProperty(oClass, "booleanDeclared", OType.BOOLEAN, true); assertProperty(oClass, "integer", OType.INTEGER); assertProperty(oClass, "short", OType.SHORT); assertProperty(oClass, "long", OType.LONG); assertProperty(oClass, "float", OType.FLOAT); assertProperty(oClass, "double", OType.DOUBLE); assertProperty(oClass, "dateTime", OType.DATETIME); assertProperty(oClass, "date", OType.DATE); assertProperty(oClass, "string", OType.STRING); assertProperty(oClass, "binary", OType.BINARY); assertProperty(oClass, "decimal", OType.DECIMAL); assertProperty(oClass, "byte", OType.BYTE); assertProperty(oClass, "custom", OType.CUSTOM); assertProperty(oClass, "transient", OType.TRANSIENT); assertProperty(oClass, "any", OType.ANY); assertProperty(oClass, "link", OType.LINK, dummyClass, null); assertProperty(oClass, "linkList", OType.LINKLIST, dummyClass, null); assertProperty(oClass, "linkSet", OType.LINKSET, dummyClass, null); assertProperty(oClass, "linkMap", OType.LINKMAP, dummyClass, null); assertProperty(oClass, "linkBag", OType.LINKBAG, dummyClass, null); assertProperty(oClass, "embedded", OType.EMBEDDED, dummyClass, null); assertProperty(oClass, "embeddedList", OType.EMBEDDEDLIST, dummyClass, null); assertProperty(oClass, "embeddedSet", OType.EMBEDDEDSET, dummyClass, null); assertProperty(oClass, "embeddedMap", OType.EMBEDDEDMAP, dummyClass, null); assertProperty(oClass, "embeddedStringSet", OType.EMBEDDEDSET, OType.STRING); assertProperty(oClass, "embeddedStringList", OType.EMBEDDEDLIST, OType.STRING); assertProperty(oClass, "embeddedStringMap", OType.EMBEDDEDMAP, OType.STRING); assertProperty(oClass, "docs", OType.LINKLIST, dummyClass, null); } finally { if(schema.existsClass("DAOAllTypesTestClass")) schema.dropClass("DAOAllTypesTestClass"); if(schema.existsClass("IDAODummyClass")) schema.dropClass("IDAODummyClass"); } }
public static OSchemaHelper describe(OSchemaHelper helper, Class<?>... classes) { DescribeContext ctx = new DescribeContext(); describe(helper, Arrays.asList(classes), ctx); ctx.close(false); return helper; }
DAO { public static OSchemaHelper describe(OSchemaHelper helper, Class<?>... classes) { DescribeContext ctx = new DescribeContext(); describe(helper, Arrays.asList(classes), ctx); ctx.close(false); return helper; } }
DAO { public static OSchemaHelper describe(OSchemaHelper helper, Class<?>... classes) { DescribeContext ctx = new DescribeContext(); describe(helper, Arrays.asList(classes), ctx); ctx.close(false); return helper; } private  DAO(); }
DAO { public static OSchemaHelper describe(OSchemaHelper helper, Class<?>... classes) { DescribeContext ctx = new DescribeContext(); describe(helper, Arrays.asList(classes), ctx); ctx.close(false); return helper; } private  DAO(); static IODocumentWrapper asWrapper(Object obj); static ODocument asDocument(Object obj); static T loadFromDocument(T obj, ODocument doc); static T save(T obj); static T reload(T obj); static T create(Class<T> interfaceClass, Class<?>... additionalInterfaces); static T create(Class<T> interfaceClass, String className, Class<?>... additionalInterfaces); static T provide(Class<T> interfaceClass, ORID iRID, Class<?>... additionalInterfaces); static T provide(Class<T> interfaceClass, ODocument doc, Class<?>... additionalInterfaces); @SuppressWarnings("unchecked") static T provide(Class<T> interfaceClass, ODocumentWrapper docWrapper, Class<?>... additionalInterfaces); @SuppressWarnings("unchecked") static T dao(Class<T> interfaceClass, Class<?>... additionalInterfaces); static OSchemaHelper describe(OSchemaHelper helper, Class<?>... classes); }
DAO { public static OSchemaHelper describe(OSchemaHelper helper, Class<?>... classes) { DescribeContext ctx = new DescribeContext(); describe(helper, Arrays.asList(classes), ctx); ctx.close(false); return helper; } private  DAO(); static IODocumentWrapper asWrapper(Object obj); static ODocument asDocument(Object obj); static T loadFromDocument(T obj, ODocument doc); static T save(T obj); static T reload(T obj); static T create(Class<T> interfaceClass, Class<?>... additionalInterfaces); static T create(Class<T> interfaceClass, String className, Class<?>... additionalInterfaces); static T provide(Class<T> interfaceClass, ORID iRID, Class<?>... additionalInterfaces); static T provide(Class<T> interfaceClass, ODocument doc, Class<?>... additionalInterfaces); @SuppressWarnings("unchecked") static T provide(Class<T> interfaceClass, ODocumentWrapper docWrapper, Class<?>... additionalInterfaces); @SuppressWarnings("unchecked") static T dao(Class<T> interfaceClass, Class<?>... additionalInterfaces); static OSchemaHelper describe(OSchemaHelper helper, Class<?>... classes);  }