Package org.exolab.castor.xml.schema.annotations.jdo

Examples of org.exolab.castor.xml.schema.annotations.jdo.Table


        Enumeration appInfos = annotation.getAppInfo();
        AppInfo appInfo = (AppInfo) appInfos.nextElement();
        List jdoContent = appInfo.getJdoContent();

        assertEquals(1, jdoContent.size());
        Table t = (Table) jdoContent.get(0);
        assertEquals("book", t.getName());
        assertEquals("isbn", t.getPrimaryKey().getKey(0));

        ElementDecl isbn = bookType.getElementDecl("isbn");
        annotations = isbn.getAnnotations();
        annotation = (Annotation) annotations.nextElement();
        appInfos = annotation.getAppInfo();
View Full Code Here


        Enumeration appInfos = annotation.getAppInfo();
        AppInfo appInfo = (AppInfo) appInfos.nextElement();
        List jdoContent = appInfo.getJdoContent();

        assertEquals(1, jdoContent.size());
        Table t = (Table) jdoContent.get(0);
        assertEquals("book", t.getName());
        assertEquals("isbn", t.getPrimaryKey().getKey(0));

        ElementDecl isbn = bookType.getElementDecl("isbn");
        annotations = isbn.getAnnotations();
        annotation = (Annotation) annotations.nextElement();
        appInfos = annotation.getAppInfo();
View Full Code Here

    /**
     * This test tries to instantiate a Table object via reflection.
     */
    public void testDomainObjectReflectionInstantiation() {
        try {
            Table table = (Table) Class.forName(
                    "org.exolab.castor.xml.schema.annotations.jdo.Table")
                    .newInstance();
            table.setName("book");
            assertEquals("book", table.getName());
        } catch (InstantiationException e) {
            e.printStackTrace();
            fail(e.getMessage());
        } catch (IllegalAccessException e) {
            e.printStackTrace();
View Full Code Here

        Enumeration appInfos = annotation.getAppInfo();
        AppInfo appInfo = (AppInfo) appInfos.nextElement();
        List jdoContent = appInfo.getJdoContent();

        assertEquals(1, jdoContent.size());
        Table t = (Table) jdoContent.get(0);
        assertEquals("book", t.getName());
        assertEquals("isbn", t.getPrimaryKey().getKey(0));

        ElementDecl isbn = bookType.getElementDecl("isbn");
        annotations = isbn.getAnnotations();
        annotation = (Annotation) annotations.nextElement();
        appInfos = annotation.getAppInfo();
View Full Code Here

                    cInfo.addNature(JDOClassInfoNature.class.getName());
                    JDOClassInfoNature cNature = new JDOClassInfoNature(cInfo);
                    while (it.hasNext()) {
                        Object tmpObject = it.next();
                        if (tmpObject instanceof Table) {
                            Table table = (Table) tmpObject;
                            cNature.setTableName(table.getName());
                            cNature.setAccessMode(AccessMode.valueOf("shared"));
                            cNature.setDetachable(table.isDetachable());
                         // TODO: Uncomment next line as soon as Annotation Classes have been updated!
//                            cNature.setAccessMode(AccessMode.valueOf(table.getAccessMode().toString()));
                            PrimaryKey pk = table.getPrimaryKey();
                            Iterator<String> pIt = pk.iterateKey();
                            while (pIt.hasNext()) {
                                cNature.addPrimaryKey(pIt.next());
                            }
                        }
View Full Code Here

TOP

Related Classes of org.exolab.castor.xml.schema.annotations.jdo.Table

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.